Function from tRibbon:
- Code: Select all Expand view RUN
- function GradientBmp( oWnd, nWidth, nHeight, aColors )
local hDC, hBmp, hBmpOld
local aRect := GetClientRect( oWnd:hWnd )
DEFAULT nHeight := aRect[ 3 ] , nWidth := aRect[ 4 ]
hDC = CreateCompatibleDC( oWnd:GetDC() )
hBmp = CreateCompatibleBitMap( oWnd:hDC, nWidth, nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, nHeight, nWidth, aColors )
SelectObject( hDC, hBmpOld )
DeleteDC( hDC )
DeleteObject( hBmpOld ) //-------->>>>> DeleteObject( hBmp )
oWnd:ReleaseDC()
return hBmp