you can use win APIGradientFill The GradientFill function fills rectangle and triangle structures. BOOL GradientFill( HDC hdc, // handle to DC PTRIVERTEX pVertex, // array of vertices ULONG dwNumVertex, // number of vertices PVOID pMesh, // array of gradients ULONG dwNumMesh, // size of gradient array ULONG dwMode // gradient fill mode );
The GradientFill function fills rectangle and triangle structures. BOOL GradientFill(
HDC hdc, // handle to DC
PTRIVERTEX pVertex, // array of vertices
ULONG dwNumVertex, // number of vertices
PVOID pMesh, // array of gradients
ULONG dwNumMesh, // size of gradient array
ULONG dwMode // gradient fill mode
);
var
Dc : HDC;
Pt : Array [0..2] of TPoint ;
Count1, count2 : Integer;
Brush : TLogbrush;
hBrush : LongInt;
begin
pt[0].x := 100;
pt[0].y := 100;
pt[1].x := 50;
pt[1].y := 150;
pt[2].x := 150;
pt[2].y := 150;
Dc := GetDC(handle);
Brush.lbStyle := BS_SOLID;
Brush.lbColor := clGreen;
Brush.lbHatch := 0;
hBrush := SelectObject(Dc,CreateBrushIndirect(Brush));
Polygon(DC,pt,3);
SelectObject(DC, hBrush);end;