Export (0) Print
Expand All
Expand Minimize

Graphics.MultiplyTransform method

Applies to: desktop apps only

The Graphics::MultiplyTransform method updates this Graphics object's world transformation matrix with the product of itself and another matrix.

Syntax

Status MultiplyTransform(
  [in]  Matrix *matrix,
  [in]  MatrixOrder order
);

Parameters

matrix [in]

Type: Matrix*

Pointer to a matrix that will be multiplied by the world transformation matrix of this Graphics object.

order [in]

Type: MatrixOrder

Optional. Element of the MatrixOrder enumeration that specifies the order of multiplication. MatrixOrderPrepend specifies that the passed matrix is on the left, and MatrixOrderAppend specifies that the passed matrix is on the right. The default value is MatrixOrderPrepend.

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 fill its world transformation matrix with the elements that represent a 30-degree rotation. Then the code calls the MultiplyTransform method to replace the world transformation matrix (which represents the 30-degree rotation) of the Graphics object with the product of itself and a translation matrix. At that point, the world transformation matrix of the Graphics object represents a composite transformation: first rotate, then translate. Finally, the code calls the DrawEllipse method to draw an ellipse that is rotated and translated.


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

   Matrix matrix;
   matrix.Translate(150.0f, 100.0f);

   graphics.RotateTransform(30.0f);                         // first rotate
   graphics.MultiplyTransform(&matrix, MatrixOrderAppend);  // then translate

   Pen pen(Color(255, 0, 0, 255));
   graphics.DrawEllipse(&pen, -80, -40, 160, 80);
}

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
Graphics::GetTransform
Matrix
MatrixOrder
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