This example effect chart:
Code 1:Unit Unit1;
Interface
Uses
Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms,
Dialogs;
Type
TForm1 = Class (Tform)
Procedure Formpaint (Sender:tobject);
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Uses Gdipobj, GDIPAPI;
Procedure Tform1.formpaint (Sender:tobject);
Const
Pt:tpoint = (x:130; Y:130);
R = 120;
colors:array[0..0] of Tgpcolor = (aclred);
Var
G:tgpgraphics;
P:tgppen;
Path:tgpgraphicspath;
Pb:tgppathgradientbrush;
PTS:ARRAY[0..4] of Tgppoint;
Radian:single;
I,num:integer;
Begin
For I: = 0 to 4 do
Begin
Radian: = i * (360*2/5) * (pi/180);
Pts[i]. X: = Pt. X + Round (Sin (radian) * R);
Pts[i]. Y: = Pt. Y-round (Cos (radian) * R);
End
G: = Tgpgraphics.create (Canvas.handle);
Path: = Tgpgraphicspath.create;
Path. Addpolygon (Pgppoint (@pts), Length (pts));
pb:= tgppathgradientbrush.create (path);
Num: = Length (colors);
Pb. Setsurroundcolors (@colors, num);
Pb. Setcentercolor (Aclyellow);
{Stroke Edge}
P: = tgppen.create (Aclyellow);
G.setsmoothingmode (Smoothingmodeantialias);
G.drawpath (P, path);
G.fillpath (Pb, Path);
Pb. Free;
Path. Free;
P.free;
G.free;
End
End.