Transparence
Posted: Sun Jan 25, 2015 1:05 am
Hello,
I have modified the timer sample, works fine, but would like to have the effect only for the dialog area, not for the whole window with titlebar etc. Is this possible ?
If not, can I fix a window without frame to another window so they are moved, destroyed and resized together with the parent window ? So I could add two windows and change the transparency to simulate a blending effect.
regards
Rudolf
I have modified the timer sample, works fine, but would like to have the effect only for the dialog area, not for the whole window with titlebar etc. Is this possible ?
If not, can I fix a window without frame to another window so they are moved, destroyed and resized together with the parent window ? So I could add two windows and change the transparency to simulate a blending effect.
regards
Rudolf
Code: Select all
#INCLUDE "dcdialog.CH"
LOCAL GetList[0], GetOptions, oTimer, oDlg, aBitmaps
aBitmaps := Directory('test*.bmp')
DCGETOPTIONS ;
WINDOWWIDTH 1024 ;
WINDOWHEIGHT 800
oTimer := DC_SetTimerEvent():new(200,{||ChangeBackground(@oDlg,aBitmaps)})
DCREAD GUI TITLE 'Rotating Bitmap Backgrounds' PARENT @oDlg OPTIONS GetOptions
oTimer:destroy()
RETURN nil
* -----------
PROC appsys ; RETURN
* -----------
STATIC FUNCTION ChangeBackground( oDlg, aBitmaps )
******************************************************************
STATIC snPointer := 0,lFirst ,oDA
LOCAL oBitmap
local nHandle,nTransparency,i
if empty(lFirst)
sleep(10)
lFirst := .f.
endif
nHandle := oDlg:getHwnd()
snPointer++
IF oDlg == nil .OR. oDlg:status() = 0 .OR. Len(aBitmaps) = 0
RETURN nil
ENDIF
IF snPointer > Len(aBitmaps)
snPointer := 1
ENDIF
oBitmap := DC_GetBitmap(aBitmaps[snPointer,1])
DC_SetWindowTransparency(nHandle,0)
FOR i := 0 TO 100 STEP 3
Sleep(1)
nTransparency := i// weniger transparenz
DC_SetWindowTransparency(nHandle,nTransparency)
NEXT
DC_SetWindowTransparency(nHandle,100)
oDlg:lockUpdate(.t.)
oDlg:drawingArea:bitmap := oBitmap
oDlg:configure()
oDlg:lockUpdate(.f.)
FOR i := 100 TO 1 STEP -3
Sleep(1)
nTransparency := i // weniger transparenz
DC_SetWindowTransparency(nHandle,nTransparency)
NEXT
DC_SetWindowTransparency(nHandle,0)
RETURN nil