Can anybody guide me on the subject.
I tried with the following code and the result is :
Regards
- Ramesh Babu P
- Code: Select all Expand view
#include "FiveWin.ch"
FUNCTION Main()
LOCAL oDlg, oBmp, hDC
DEFINE DIALOG oDlg SIZE 212, 106 ;
COLORS CLR_BLACK, nRGB(224,167,64) TRANSPARENT PIXEL
@ 10, 15 BITMAP oBmp FILE "C:\FWH\BITMAPS\QUESTION.BMP" OF oDlg ;
SIZE 20, 30 PIXEL NOBORDER
ACTIVATE DIALOG oDlg CENTERED ON PAINT ;
gradiate_(oDlg, hDC, {CLR_WHITE, nRgb(224,167,64)}, ;
2,{0,0,oDlg:nHeight,oDlg:nWidth})
RETURN nil
******************************************************************
FUNCTION gradiate_( hWnd, hDC, aClrPan, nFund, aCoors)
LOCAL nColor1, nColor2, nSoma, nSteps
LOCAL nColorR1, nColorB1, nColorG1, nColorR2, nColorB2, nColorG2
LOCAL nSomaR, nSomaG, nSomaB
LOCAL nTamaAlt, nTamaLar, nFundAlt, nFundLar, aRect, aRect1, oBrush
nTamaAlt := (aCoors[3]-aCoors[1])
nTamaLar := (aCoors[4]-aCoors[2])
nFundAlt := nTamaAlt
aRect := {0,0,nFundAlt,nTamaLar}
nSteps := nFundAlt
nSoma := nSteps / 100
nColor1 := aClrPan[Iif(nFund>0,1,2)]
nColor2 := aClrPan[Iif(nFund>0,2,1)]
nColorR1 := nRgbRed(nColor1)
nColorG1 := nRgbGreen(nColor1)
nColorB1 := nRgbBlue(nColor1)
nColorR2 := nRgbRed(nColor2)
nColorG2 := nRgbGreen(nColor2)
nColorB2 := nRgbBlue(nColor2)
nSomaR := Abs(nColorR2-nColorR1)
nSomaG := Abs(nColorG2-nColorG1)
nSomaB := Abs(nColorB2-nColorB1)
nSomaR := IIF( nSomaR < 0,1,(nSomaR/(nFundAlt/2)))
nSomaG := IIF( nSomaG < 0,1,(nSomaG/(nFundAlt/2)))
nSomaB := IIF( nSomaB < 0,1,(nSomaB/(nFundAlt/2)))
aRect[3] := 0
DO WHILE aRect[3] <= nFundAlt
aRect[ 3 ] += nSoma
DEFINE BRUSH oBrush COLOR nRGB(nColorR1 , nColorG1, nColorB1 )
FillRect( hDC, aRect, oBrush:hBrush )
RELEASE Brush oBrush
aRect[ 1 ] += nSoma
nColorR1 := INT(IIF(nColorR2 >= nColorR1,nColorR1+nSomaR,nColorR1-nSomaR))
nColorG1 := INT(IIF(nColorG2 >= nColorG1,nColorG1+nSomaG,nColorG1-nSomaG))
nColorB1 := INT(IIF(nColorB2 >= nColorB1,nColorB1+nSomaB,nColorB1-nSomaB))
nColorR1 := IIF(nColorR1<0,0,IIF(nColorR1>255,255,nColorR1))
nColorG1 := IIF(nColorG1<0,0,IIF(nColorG1>255,255,nColorG1))
nColorB1 := IIF(nColorB1<0,0,IIF(nColorB1>255,255,nColorB1))
ENDDO
SysRefresh()
RETURN nil
**********