FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Transparent Buttons (BtnBMP) on Circle-Grad.-Backgrd. ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Transparent Buttons (BtnBMP) on Circle-Grad.-Backgrd. ?
Posted: Sat Jan 09, 2010 12:25 AM
Hello,

testing all possible Combinations of < BTNBMP >
I noticed a problem with transparent Button-painting
on the new Gradient-Circle-background.
There is only the Function : GradientBrush
This function doesn't work with Circle-Gradient.
I think, we need a extra Function, to paint anything transparent on Circle-Gradient.

Code (fw): Select all Collapse
FUNCTION GradientBrush( oDlg, aColors, lPos )
local hDC, hBmp, hBmpOld, oBrush

if Empty( oDlg:oBrush:hBitmap )
      hDC = CreateCompatibleDC( oDlg:GetDC() )
      hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight )
      hBmpOld = SelectObject( hDC, hBmp )
      GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aColors, lPos )
      DeleteObject( oDlg:oBrush:hBrush )
      oDlg:oBrush:hBitmap = hBmp
      oDlg:oBrush:hBrush = CreatePatternBrush( hBmp ) 
      SelectObject( hDC, hBmpOld )
      oDlg:ReleaseDC()
endif   

RETURN NIL


With normal Gradient ( Horizontal / Vertical ) it works.
Is there a Solution for it ?

Normal Gradient :


Result with Circle Gradient :


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion