Dear Antonio and friends, Good afternoon!
Exists any way to create a gradient effect into TPanel class? The visual effect 2007?
Gradient on TPanel?
Gradient on TPanel?
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Gradient on TPanel?
A preliminary Solution :
Create a Gradient-Bmp and use it as a Brush.
If You want to use a vertical-gradient, the Bmp-length must be >= Panel-length,
otherwise the gradient is shown tiled.
DEFINE BRUSH oBrush FILENAME "..\bitmaps\16x16\Gradient1.bmp"
oPanel := TPanel():New( 0, 0, 75, 290, oReBar )
oPanel:SetBrush( oBrush )
Best Regards
Uwe
Create a Gradient-Bmp and use it as a Brush.
If You want to use a vertical-gradient, the Bmp-length must be >= Panel-length,
otherwise the gradient is shown tiled.
DEFINE BRUSH oBrush FILENAME "..\bitmaps\16x16\Gradient1.bmp"
oPanel := TPanel():New( 0, 0, 75, 290, oReBar )
oPanel:SetBrush( oBrush )
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Re: Gradient on TPanel?
Great Uwe!
But, without a image file... it's possible too?
Some like this:
But, without a image file... it's possible too?
Some like this:
Code: Select all
lLook2007 := .T.
oBar := TBar():New( oWnd, 100, 68, .T., "TOP",, lLook2007 )
oPanel := TPanel():New( 0, oBar:nLeft, 68, oBar:nRight, oBar )
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Gradient on TPanel?
Hello JC,
the tPanel-Class includes only in ON PAINT :
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
I can test, if it is possible to change this with < Gradientfill > maybe it works.
Best regards
Uwe
the tPanel-Class includes only in ON PAINT :
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
I can test, if it is possible to change this with < Gradientfill > maybe it works.
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Re: Gradient on TPanel?
Dear Uwe,
I tried but, not work
I tried but, not work
Code: Select all
IF ::l2007
GradientFill( ::hDC, 0, 0, ::nHeight, ::nWidth, Eval( ::bClrGrad, .f. ) )
return 0
ENDIF
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Gradient on TPanel?
tpanel has an error on paint method.
Antonio erased the line where call the function floodfill because when we use different tpanel there is an error on hbrush variable.
If you want the same effect of tpanel you must create a dialog with Nor 4 style and insert at right scrollbar if you want.
Only with this dialog tou can use graduent functiin to
colorize it.
but this is only an mine idea!
Antonio erased the line where call the function floodfill because when we use different tpanel there is an error on hbrush variable.
If you want the same effect of tpanel you must create a dialog with Nor 4 style and insert at right scrollbar if you want.
Only with this dialog tou can use graduent functiin to
colorize it.
but this is only an mine idea!
Best Regards, Saludos
Falconi Silvio
Falconi Silvio