Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GradientFIll
Message
 
 
To
28/12/2002 04:14:37
Daniel C.
InfoData Bacau
Bacau, Romania
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00736262
Message ID:
00736304
Views:
12
Here's the working sample code based on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_7nj9.asp. It uses late Ed Rauh's Heap allocation class File #9482.
#define GRADIENT_FILL_RECT_H    0x00000000
#define GRADIENT_FILL_RECT_V    0x00000001
#define GRADIENT_FILL_TRIANGLE  0x00000002
#define GRADIENT_FILL_OP_FLAG   0x000000ff


SET PROCEDURE TO CLSHEAP ADDITIVE

DECLARE Long ReleaseDC IN WIN32API Long HWND, Long HDC
DECLARE Long GetDC IN WIN32API Long HWND

DECLARE LONG GradientFill IN Msimg32.dll Long, STRING @, Long, STRING @, LONG, LONG

lnHDC = GetDC(0)

oHeap = CREATEOBJ('Heap')
lcVert0 = ;
		NumToDWORD(0) + ; 	&& x 
		NumToDWORD(0) + ; 	&& y
		NumToWORD(0x0000) + ; 	&& Red
		NumToWORD(0x0000) + ; 	&& Green
		NumToWORD(0x0000) + ; 	&& Blue
		NumToWORD(0x0000) 	&& Alpha

lcVert1 = ;
		NumToDWORD(200) + ;	&& x 
		NumToDWORD(132) + ; 	&& y
		NumToWORD(0x0000) + ; 	&& Red
		NumToWORD(0x0000) + ; 	&& Green
		NumToWORD(0xff00) + ; 	&& Blue
		NumToWORD(0x0000) 	&& Alpha

lcVert = lcVert0 + lcVert1
lcgRect = ;
		NumToDWORD(0) + ; 		&& UpperLeft  
		NumToDWORD(1) 			&& LowerRight 

? GradientFill(lnhDc, @lcVert,2, @lcgRect,1,GRADIENT_FILL_RECT_H)

= ReleaseDC(0, lnHDC )
RETURN
>Hi, maybe this will be a newbie question but i'll take the chance:
>
>I've declared the GradientFill function and use it; the result seems to be ok .t. / 1 but the getlasterror return 3 wich makes no sense and of course no fill area is generated. Please help !!!!
>
>
>Regards !!!
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform