is there a solution, painting controls
transparent on FILLRECT ?
The dialog background is splitted in 3 sections with different bush-styles.
Called inside the Dialog :
oGDialog:bPainted := {|hDC| D_BRUSH2 (oGDialog, hDC, nSplTop, cPBrush) }
Defined inside the Function ::
hBmp = ReadBitmap( 0, c_path1 + cPBrush[I] )
hBrush = CreatePatternBrush( hBmp )
DeleteObject( hBmp )
FillRect( hDC, { nSplTop[I], 0, nSplBott[I], oGDialog:nWidth }, hBrush )
A sample :
- Code: Select all Expand view
FUNCTION MAIN()
LOCAL oDlg, oSay1, oSay2
c_path := cFilePath(GetModuleFileName( GetInstance() ) )
c_path1 := c_path + "IMAGES\"
oFont := TFont():New("Arial",0,-40,.F.,.T.,0,0,0,.T. )
DEFINE BRUSH oBrush FILE c_path1 + "Paper.bmp"
DEFINE DIALOG oDlg from 0,0 to 400, 500 pixel TITLE "Brush-Test" BRUSH oBrush TRANSPARENT
@ 30, 30 SAY oSay1 PROMPT "Transparent Say 1" ;
OF oDlg SIZE 190, 30 FONT oFont PIXEL
oSay1:SetColor( 0, )
@ 130, 30 SAY oSay2 PROMPT "Transparent Say 2" ;
OF oDlg SIZE 190, 30 FONT oFont PIXEL
oSay2:SetColor( 0, )
oDlg:bPainted := {|hDC| SET_BRUSH( oDlg, hDC, "Blustone.bmp" ) }
ACTIVATE DIALOG oDlg CENTERED
oFont:End()
RETURN NIL
//--------- 2. Brush ------------------------
FUNCTION SET_BRUSH( oDlg, hDC, cBrush )
LOCAL oImage, oBrush, hBmp
hBmp = ReadBitmap( 0, c_path1 + cBrush )
hBack = CreatePatternBrush( hBmp )
DeleteObject( hBmp )
FillRect( hDC, { 150, 0, oDlg:nHeight, oDlg:nWidth }, hBack )
RETURN NIL
Best Regards
Uwe