Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Graphics.GetTransform method

Applies to: desktop apps only

The Graphics::GetTransform method gets the world transformation matrix of this Graphics object.

Syntax

Status GetTransform(
  [out]  Matrix* matrix
);

Parameters

matrix [out]

Type: Matrix*

Pointer to a Matrix object that receives the transformation matrix.

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 calls the Graphics::RotateTransform method of a Graphics object to set the world transformation matrix of that Graphics object. Then the code calls the Graphics::GetTransform method of the Graphics object to obtain its world transformation matrix (which now represents a 30-degree rotation). The call to GetElements copies the elements of the retrieved matrix to an array.


VOID Example_GetTransform(HDC hdc)
{
   Graphics graphics(hdc);

   graphics.RotateTransform(30.0f);

   Matrix matrix;
   REAL elements[6];
   graphics.GetTransform(&matrix);
   matrix.GetElements(elements);

   for(INT j = 0; j <= 5; ++j)
   {
      // Inspect or use the value in elements[j].
   }
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics
Matrix
MatrixOrder
Graphics::MultiplyTransform
Graphics::ResetTransform
Graphics::RotateTransform
Graphics::ScaleTransform
Graphics::SetTransform
Graphics::TransformPoints
Graphics::TranslateTransform
Transformations
Coordinate Systems and Transformations

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2015 Microsoft