Condividi tramite


Matrix.TransformPoints(PointF*, INT) method

Applies to: desktop apps only

The Matrix::TransformPoints method multiplies each point in an array by this matrix. Each point is treated as a row matrix. The multiplication is performed with the row matrix on the left and this matrix on the right.

Syntax

Status TransformPoints(
  [in, out]  PointF *pts,
  [in]       INT count
);

Parameters

  • pts [in, out]
    Type: PointF*

    Pointer to an array of PointF objects that, on input, contains the points to be transformed and, on output, receives the transformed points. Each point in the array is transformed (multiplied by this matrix) and updated with the result of the transformation.

  • count [in]
    Type: INT

    Optional. Integer that specifies the number of points to be transformed. The default value is 1.

Return value

Type:

Type: Status****

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Examples

The following example creates an array of five points and then transforms those points by calling the Matrix::TransformPoints method of a Matrix object. The code passes the array of points to the DrawCurve Methods method before the transformation and again after the transformation.

VOID Example_TransPointsF(HDC hdc)
{
   Graphics graphics(hdc);
   Pen pen(Color(255, 0, 0, 255));

   PointF points[5] = {
      PointF(50.0f, 100.0f), 
      PointF(100.0f, 50.0f),
      PointF(150.0f, 125.0f),
      PointF(200.0f, 100.0f),
      PointF(250.0f, 150.0f)};

   Matrix matrix(1.0f, 0.0f, 0.0f, 2.0f, 0.0f, 0.0f);

   graphics.DrawCurve(&pen, points, 5);
   matrix.TransformPoints(points, 5);
   graphics.DrawCurve(&pen, points, 5);  
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusmatrix.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Matrix

PointF

TransformPoints Methods

TransformVectors Methods

Transformations

Global and Local Transformations

Matrix Representation of Transformations

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012