Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The Matrix::Reset method updates this matrix with the elements of the identity matrix.
Status Reset();
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.
The elements on the main diagonal of the identity matrix are 1. All other elements of the identity matrix are 0.
The following example creates a Matrix object that represents a horizontal scaling by a factor of 5 and a vertical scaling by a factor of 3. The code calls the Matrix::Reset method to replace the elements of that matrix with the elements of the identity matrix. Then the code calls the Matrix::Translate method to update the matrix with the product of itself (the identity) and a translation matrix. The result is that the matrix represents only the translation, not the scaling. The code uses the matrix to set the world transformation of a Graphics object and then draws a rectangle that is transformed according to that world transformation.
VOID Example_Reset(HDC hdc)
{
Graphics graphics(hdc);
Pen pen(Color(255, 0, 0, 255));
Matrix matrix(5.0f, 0.0f, 0.0f, 3.0f, 0.0f, 0.0f);
matrix.Reset();
matrix.Translate(50.0f, 40.0f);
graphics.SetTransform(&matrix);
graphics.DrawRectangle(&pen, 0, 0, 100, 100);
}
Requirement | Value |
---|---|
Minimum supported client | Windows XP, Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | gdiplusmatrix.h (include Gdiplus.h) |
Library | Gdiplus.lib |
DLL | Gdiplus.dll |
Global and Local Transformations
Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!