This example effect chart:
Code files:Unit Unit1;
Interface
Uses
Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms,
Dialogs, Stdctrls;
Type
TForm1 = Class (Tform)
Listbox1:tlistbox;
Procedure Formcreate (Sender:tobject);
Procedure Formpaint (Sender:tobject);
Procedure Listbox1click (Sender:tobject);
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Uses Gdipobj, GDIPAPI;
Procedure Tform1.formcreate (Sender:tobject);
Begin
Listbox1.align: = Alright;
With Listbox1.items do
Begin
ADD (' Smoothingmodeinvalid ');
ADD (' Smoothingmodedefault ');
ADD (' smoothingmodehighspeed ');
ADD (' smoothingmodehighquality ');
ADD (' Smoothingmodenone ');
ADD (' Smoothingmodeantialias ');
End
End
Procedure Tform1.formpaint (Sender:tobject);
Var
G:tgpgraphics;
P:tgppen;
Begin
G: = Tgpgraphics.create (Canvas.handle);
P: = Tgppen.create (aclred, 2);
G.setsmoothingmode (listbox1.itemindex-1);
G.drawellipse (P, ten, clientwidth-listbox1.width-20, ClientHeight-20);
G.drawline (p, 0, 0, clientwidth-listbox1.width, clientheight);
G.drawline (p, clientwidth-listbox1.width, 0, 0, clientheight);
P.free;
G.free;
End
Procedure Tform1.listbox1click (Sender:tobject);
Begin
Repaint;
End
End.