Gdiplus [36]: Data in the igpgraphicspath (3) path

Source: Internet
Author: User
Igpgraphicspath. pointcount; // the total number of points igpgraphicspath. pathpoints; // vertex array, floating point igpgraphicspath. pathpointsi; // vertex array, integer igpgraphicspath. pathtypes; // point type array igpgraphicspath. pathdata; // point and point data; igppathdata type igpgraphicspath. getlastpoint; // igpgraphicspath. reverse; // reverse the point order igpgraphicspath. getbounds (); // obtain the enclosed rectangle

  {About the vertex type (it is a byte value )} 0 // indicates that this vertex is the starting point of the graph. 1 // indicates that this vertex is one of the two ending points of a line segment. 3 // indicates that this vertex isCubeThe end point or control point of the besell spline $7 // used for three-bit mask operations, it should not actually exist $20 // specify this point as a marker (TAG) $80 // specify that this point is the last point in the closed sub-path (graph) // The actual read value. Otherwise, the point should have a dual identity.

  

Pathpoints, pathtypes, and pathdata test charts:


Pathpoints, pathtypes, and pathdata Test Code :
 uses gdiplus; Procedure convert (Sender: tobject); var graphics: igpgraphics; Path: igpgraphicspath; brush, brushpt, brushtext: igpsolidbrush; Pt: tgppointf; pttype: byte; I: integer; begin graphics: = tgpgraphics. create (handle); brush: = tgpsolidbrush. create ($ ffc0c0c0); brushpt: = tgpsolidbrush. create ($80ff0000); brushtext: = tgpsolidbrush. create ($ ff000000); Path: = tgpgraphicspath. create; Path. addstring ('A', tgpfontfamily. create ('arial black'), [], 200, tgppoint. create (0, 0), nil); Path. addellipse (210, 76,100,144); graphics. fillpath (brush, PATH); for I: = 0 to path. pointcount-1 do begin PT: = path. pathpoints [I]; pttype: = path. pathtypes [I]; // The last two rows can also be written: // PT: = path. pathdata. points [I]; // pttype: = path. pathdata. types [I]; graphics. fillrectangle (brushpt, PT. x-3, PT. y-3 (6, 6); graphics. drawstring (format ('% x', [pttype]), tgpfont. create (canvas. handle), Pt, brushtext); end;

   

Test code for getlastpoint, reverse, and pathpointsi:

 
Uses gdiplus; Procedure tform1.formpaint (Sender: tobject); var path: igpgraphicspath; ptstart: tgppoint; ptend: tgppointf; begin path: = tgpgraphicspath. create; Path. addrectangle (tgprect. create (1, 2, 3, 4); ptstart: = path. pathpointsi [0]; ptend: = path. getlastpoint; showmessagefmt ('% d; % d, % G; % G', [ptstart. x, ptstart. y, ptend. x, ptend. y]); {(1; 2), (1; 6)} path. reverse; ptstart: = path. pathpointsi [0]; ptend: = path. getlastpoint; showmessagefmt ('% d; % d, % G; % G', [ptstart. x, ptstart. y, ptend. x, ptend. y]); {(1; 6), (1; 2)} end;

  

Getbounds test diagram:


Getbounds test code:
 uses gdiplus; Procedure tform1.formpaint (Sender: tobject); var graphics: igpgraphics; Path: igpgraphicspath; pen: igppen; rect: tgprect; begin graph: = tgpgraphics. create (handle); pen: = tgppen. create ($ ffff0000, 2); Path: = tgpgraphicspath. create; Path. addline (20, 20,150,100); graphics. drawpath (pen, PATH); pen. width: = 1; pen. color: = $ ffc0c0c0; Path. getbounds (rect); graphics. drawrectangle (pen, rect); end;

   

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.