it make a strange gpf
I use xp professional sp3
- Code: Select all Expand view
#include "FiveWin.ch"
Function test()
Local oDlg,oGroup,oBmp1
DEFINE DIALOG oDlg From 10, 4 to 28,70 TiTle "test"
@ 0,0.7 GROUP oGroup TO 3.8,30.5 PROMPT "test of the test" OF oDlg COLOR CLR_YELLOW, CLR_BLUE
oGroup:ltransparent:=.T.
@ 1,28 BITMAP oBmp1 FILENAME "OmbrG.BMP" NOBORDER SIZE 100,50
oBmp1:ltransparent:=.T.
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT GradientBrush( oDlg, { { 0.4, nRGB( 75, 144, 223 ), nRGB( 41, 85, 145 ) },;
{ 0.6, nRGB( 24, 61, 118 ), nRGB( 50, 95, 158 ) } } )
return nil
function GradientBrush( oDlg, aColors )
local hDC, hBmp, hBmpOld
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 )
oDlg:oBrush:hBitmap = hBmp
oDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC, hBmpOld )
oDlg:ReleaseDC()
endif
return nil
DLL32 FUNCTION CreateCompatibleBitmap( hDC AS LONG, nWidth AS LONG, nHeight AS LONG ) AS LONG ;
PASCAL FROM "CreateCompatibleBitmap" LIB "gdi32.dll"