Direct2d (22): id2d1transformedgeometry of composite geometric objects

Source: Internet
Author: User
The composite ry objects include id2d1geometrygroup and id2d1transformedgeometry, all of which are inherited from id2d1geometry.

Id2d1transformedgeometry only contains the id2d1geometry of 2D transformations.

Uses direct2d, d2d1; Procedure destroy (Sender: tobject); var CVS: tdirect2dcanvas; itransformedgeometry: Ignore; irectanglegeometry: Ignore; igeometry: id2d1geometry; R: trect; begin {create a rectangle of id2d1geometry} r: = bounds (ClientWidth-100) Div 2, (ClientHeight-100) Div 2,100,100); d2dfactory. createrectanglegeometry (R, irectanglegeometry); {create id2d1transformedgeometry} d2dfactory. createtransformedgeometry (irectanglegeometry, td2dmatrix3x2f. rotation (45, clientwidth/2, clientheight/2), itransformedgeometry); CVS: = tdirect2dcanvas. create (canvas, clientrect); CVs. begindraw; {drawing original rectangle} CVs. pen. color: = clgreen; CVs. pen. width: = 11; CVs. drawgeometry (irectanglegeometry); {draw id2d1transformedgeometry} CVs. brush. color: = clgreen; CVs. fillgeometry (itransformedgeometry); {draw the igeometry retrieved again from id2d1transformedgeometry} CVs. pen. color: = clwhite; CVs. pen. width: = 1; itransformedgeometry. getsourcegeometry (igeometry); CVs. drawgeometry (igeometry); CVs. enddraw; CVs. free; end; Procedure tform1.formresize (Sender: tobject); begin repaint; 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.