8
Classes, SysUtils, LCLProc, FileUtil, LResources, Forms, Controls, Graphics,
9
Dialogs, FPimage, agg_fpimage, Agg_LCL;
16
procedure FormCreate(Sender: TObject);
17
procedure FormDestroy(Sender: TObject);
18
procedure FormPaint(Sender: TObject);
21
AggLCLCanvas: TAggLCLCanvas;
32
procedure TForm1.FormCreate(Sender: TObject);
36
Bitmap1:=TBitmap.Create;
37
AggLCLCanvas:=TAggLCLCanvas.Create;
38
with AggLCLCanvas do begin
39
Image.PixelFormat:=afpimRGBA32;
40
Image.SetSize(250,250);
43
// paint to agg canvas
44
with AggLCLCanvas do begin
45
// solid white background
47
FillRect(0,0,Width,Height);
49
// a star with 5 corners, solid blue outline, filled solid yellow
50
Brush.Color:=clYellow;
53
Ellipse(20,50,100,100);
55
// a star with 5 corners, transparent blue outline, filled transparent yellow
56
Brush.FPColor:=FPColor($ffff,$ffff,0,$5000);
57
Pen.FPColor:=FPColor(0,0,$ffff,$5000);
58
Ellipse(40,65,120,130);
61
FontFilename:=SetDirSeparators('../../verdana.ttf');
62
DebugLn(['TForm1.FormCreate ',FontFilename,' ',FileExistsUTF8(FontFilename)]);
63
Font.LoadFromFile(FontFilename);
66
TextOut(10,30,'LCL and AggPas');
69
// convert to LCL native pixel format
70
Bitmap1.LoadFromIntfImage(AggLCLCanvas.Image.IntfImg);
73
procedure TForm1.FormDestroy(Sender: TObject);
79
procedure TForm1.FormPaint(Sender: TObject);
81
Canvas.Draw(0,0,Bitmap1);