-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrotate3.pas
More file actions
48 lines (38 loc) · 972 Bytes
/
rotate3.pas
File metadata and controls
48 lines (38 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
program AggEx;
uses
SysUtils,
AggExample,
agg_2D,
agg_basics;
type
TAggExample1 = class(TAggExample)
protected
procedure Draw(agg: Agg2D_ptr); override;
end;
const
SURFACE_WIDTH = 480;
SURFACE_HEIGHT = 480;
procedure TAggExample1.Draw(agg: Agg2D_ptr);
begin
agg^.clearAll(0, 0, 0, 0);
//agg^.noLine;
//agg^.fillColor(0, 0, 255);
agg^.lineColor(0, 0, 255);
agg^.lineWidth(0.05);
agg^.scale(SURFACE_WIDTH, SURFACE_HEIGHT);
agg^.translate(SURFACE_WIDTH div 2, SURFACE_HEIGHT div 2);
//agg^.translate(0.5, 0.5);
//agg^.scale(SURFACE_WIDTH, SURFACE_HEIGHT);
agg^.translate(-SURFACE_WIDTH div 2, -SURFACE_HEIGHT div 2);
agg^.rotate(PI / 4);
agg^.translate(SURFACE_WIDTH div 2, SURFACE_HEIGHT div 2);
agg^.rectangle(-0.25, -0.25, 0.25, 0.25);
end;
var
p: TAggExample1;
begin
p := TAggExample1.Create(SURFACE_WIDTH, SURFACE_HEIGHT, ChangeFileExt({$I %FILE%}, '.png'));
p.DrawImage;
p.SaveToPng;
p.Free;
end.