//Draw with Fill path var
g:tgpgraphics
Path:tgpgraphicspath;
P:tgppen;
Sb:tgpsolidbrush;
Begin
G: = Tgpgraphics.create (canvas.handle);
P: = Tgppen.create (Makecolor (128,255,0,0), 4);
SB: = Tgpsolidbrush.create (Makecolor (128,255,255,0));
Path: = tgpgraphicspath.create;
Path. Startfigure;
Path. AddLine (Makepoint (11,11), Makepoint (222,111));
Path. Addbezier (Makepoint (11,11), Makepoint (33,111), Makepoint (66,6), Makepoint (111,111));
Path. Closefigure;
G.drawpath (P, path);
G.fillpath (SB, path);
P.free;
SB. Free;
Path. Free;
G.free;
End;
A combination of inflection points in a pathvar
g: TGPGraphics;
p: TGPPen;
path: TGPGraphicsPath;
p1,p2,p3: TGPPoint;
begin
g := TGPGraphics.Create(Canvas.Handle);
p:= TGPPen.Create(MakeColor(255, 0, 0, 255),8);
path:= TGPGraphicsPath.Create;
p1.X := 50; p1.Y := 200;
p2.X := 100; p2.Y := 200;
p3.X := 100; p3.Y := 250;
path.AddLine(p1, p2);
path.AddLine(p2, p3);
p.SetLineJoin(LineJoinBevel); {设置结合样式}
g.DrawPath(p, path);
path.Free;
p.Free;
g.Free;
end;
The inflection point in a path combines styles:
Microsoft |
description |
linejoinbevel |
bevel |
The join that is specified as a bevel. This will produce a bevel. |
linejoinmiter |
mite R |
|
miterclipped the |
Specifies the miter join. This produces an acute angle or bevel, depending on whether the length of the miter exceeds the miter limit. |
linejoinround |
roun D |
|