! WindowFromDC lib "user32.dll" (sys hDc) as sys
! CreateSolidBrush lib "GDi32.dll" (byte COLORREF crColor)
' draws with color gradient
SUB DrawGradient (BYVAL hDC AS DWORD)
LOCAL rectFill AS RECT, rectClient AS RECT, fStep AS SINGLE, hBrush AS DWORD, lOnBand AS LONG
GetClientRect WindowFromDC(hDC), rectClient
fStep = rectClient.bottom / 200
FOR lOnBand = 0 TO 199
SetRect rectFill, 0, lOnBand * fStep, rectClient.right + 1, (lOnBand + 1) * fStep
' paint the background -- change the first 2 colors R and G
' to vary the color gradient
hBrush = CreateSolidBrush(rgb(228, 250, 238 - lOnBand))
Fillrect hDC, rectFill, hBrush
DeleteObject hBrush
NEXT
END SUB
(This smiley should read "8")
Function RGB(sys red,green,blue) as sys
sys color
color = red
color = color + green*256
color = color + blue*65536
Return color
End Function