This example effect chart:
Code files:Unit Unit1;
Interface
Uses
Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms,
Dialogs, Stdctrls, Checklst, Extctrls, Tecanvas, Comctrls;
Type
TForm1 = Class (Tform)
Trackbar1:ttrackbar;
Trackbar2:ttrackbar;
Procedure Formcreate (Sender:tobject);
Procedure Formdestroy (Sender:tobject);
Procedure Formpaint (Sender:tobject);
Procedure Trackbar1change (Sender:tobject);
Procedure Trackbar2change (Sender:tobject);
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Uses Gdipobj, GDIPAPI;
Var
Rect:tgprect;
Pb:tgppathgradientbrush;
Procedure Tform1.formcreate (Sender:tobject);
Var
Path:tgpgraphicspath;
Colorsurround:tgpcolor;
Num:integer;
Begin
Rect: = Makerect (Ten, ClientWidth-40, ClientHeight-40);
Path: = Tgpgraphicspath.create;
Path. AddEllipse (rect);
PB: = tgppathgradientbrush.create (path);
Pb. Setcentercolor (Acllime);
Colorsurround: = Aclblack;
num: = 1;
Pb. Setsurroundcolors (@ColorSurround, num);
Path. Free;
DoubleBuffered: = True;
Trackbar1.max: = 100;
Trackbar2.max: = 100;
End
Procedure Tform1.formdestroy (Sender:tobject);
Begin
Pb. Free;
End
Procedure Tform1.formpaint (Sender:tobject);
Var
G:tgpgraphics;
P:tgppen;
X,y:single;
Begin
G: = Tgpgraphics.create (Canvas.handle);
P: = tgppen.create (aclred);
G.fillellipse (Pb, Rect);
Pb. Setcenterpoint (Makepoint) (rect. X + rect. Width Div 2, rect. Y + rect. Height Div 2));
{Setfocusscales}
Pb. Setfocusscales (trackbar1.position/100, trackbar2.position/100);
{Getfocusscales}
Pb. Getfocusscales (x, y);
Text: = Format ('%f,%f ', [x,y]);
P.free;
G.free;
End
Procedure Tform1.trackbar1change (Sender:tobject);
Begin
Repaint;
End
Procedure Tform1.trackbar2change (Sender:tobject);
Begin
Repaint;
End
End.