Delphi GDI + Learning Records (19): Path

Source: Internet
Author: User
Tags join

//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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.