Transparent Buttons (BtnBMP) on Circle-Grad.-Backgrd. ?

Transparent Buttons (BtnBMP) on Circle-Grad.-Backgrd. ?

Postby ukoenig » 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: Select all  Expand view

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 :
Image

Result with Circle Gradient :
Image

Best Regards
Uwe :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests