Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Matrix.Scale method

Applies to: desktop apps only

The Matrix::Scale method updates this matrix with the product of itself and a scaling matrix.

Syntax

Status Scale(
  [in]  REAL scaleX,
  [in]  REAL scaleY,
  [in]  MatrixOrder order
);

Parameters

scaleX [in]

Type: REAL

Real number that specifies the horizontal scale factor.

scaleY [in]

Type: REAL

Real number that specifies the vertical scale factor.

order [in]

Type: MatrixOrder

Optional. Element of the MatrixOrder enumeration that specifies the order of the multiplication. MatrixOrderPrepend specifies that the scaling matrix is on the left, and MatrixOrderAppend specifies that the scaling 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 creates a Matrix object and calls the Matrix::Rotate method to set the elements of that matrix to a rotation. Then the code calls the Matrix::Scale method to update the matrix with the product of itself and a scaling matrix. At that point, the matrix represents a composite transformation: first rotate, then scale. The code uses the matrix to set the world transformation of a Graphics object and then draws an ellipse that is transformed according to the composite transformation.


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

   Matrix matrix;
   matrix.Rotate(30.0f);  
   matrix.Scale(3.0f, 2.0f, MatrixOrderAppend);

   graphics.SetTransform(&matrix);

   // Draw a tramsformed ellipse. The composite transformation
   // is rotate 30 degrees and then scale by a factor of 3
   // in the horizontal direction and 2 in the vertical direction.
   graphics.DrawEllipse(&pen, 0, 0, 80, 40); 
}

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
MatrixOrder
Matrix::Multiply
Matrix::Rotate
Matrix::RotateAt
Matrix::Shear
Matrix::Translate
Transformations
Global and Local Transformations
Matrix Representation of Transformations

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

Show: