Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-03

GradientFill

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jóni Silva

Hi,
I'm trying to implement the gradientfill function in WINCE. Altough it successfully calls the function is displays everything black.

*Can anyone tell me what's wrong?* [image: Wacko]

*GradientFill implementation*

Show quoted text 25 lines
TTriVertex = packed record x: Longint; y: Longint; Red: Word; Green: Word; Blue: Word; Alpha: Word; end; TGRADIENTRECT = record UpperLeft : Cardinal; LowerRight : cardinal; end; function GradientFill(DC: dword {HDC}; Verteces: Pointer; NumVerteces: DWORD; Meshes: Pointer; NumMeshes: DWORD; Mode: DWORD): DWORD; stdcall; external 'coredll.dll'; const GRADIENT_FILL_RECT_H = $00000000; GRADIENT_FILL_RECT_V = $00000001; GRADIENT_FILL_TRIANGLE = $00000002; GRADIENT_FILL_OP_FLAG = $000000ff;

*Listbox drawitem event:*

Show quoted text 24 lines
var Verteces: array[0..1] of TTriVertex; GradientRect: TGradientRect; begin Verteces[0].x := rect.left; Verteces[0].y := rect.top; Verteces[0].Red := $0000; Verteces[0].Green := $0034; Verteces[0].Blue := $0034; Verteces[0].Alpha := $0000; Verteces[1].x := rect.right; Verteces[1].y := rect.bottom; Verteces[1].Red := $0000; Verteces[1].Green := $0045; Verteces[1].Blue := $0067; Verteces[1].Alpha := $0000; GradientRect.UpperLeft := 0; GradientRect.LowerRight := 1; GradientFill(dc, @Verteces[0], 2, @GradientRect, 1, GRADIENT_FILL_RECT_H);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090327/348e6e8a/attachment-0001.html

Reply by email