Graphics.TransformPoints Method (CoordinateSpace, CoordinateSpace, PointF[])

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Transforms an array of points from one coordinate space to another using the current world and page transformations of this Graphics.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

member TransformPoints : 
        destSpace:CoordinateSpace *
        srcSpace:CoordinateSpace *
        pts:PointF[] -> unit

Parameters

destSpace
Type: System.Drawing.Drawing2D.CoordinateSpace

Member of the CoordinateSpace enumeration that specifies the destination coordinate space.

srcSpace
Type: System.Drawing.Drawing2D.CoordinateSpace

Member of the CoordinateSpace enumeration that specifies the source coordinate space.

pts
Type: System.Drawing.PointF[]

Array of PointF structures that represent the points to transform.

The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. The code performs the following actions:

  • Creates two points and draws a blue line between them.

  • Sets the world transform to translate by amounts 40 in the x direction and 30 in the y direction.

  • Transforms the points from world coordinates (World) to page coordinates (Page).

  • Resets the world transformation to the identity and draws a red line between the transformed points.

The result is a blue line and a translated red line below it.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: