//繪制與填充路徑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;var
end;路徑中的拐點結合樣式:
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;