TextureBrush::ResetTransform method (gdiplusbrush.h)
The TextureBrush::ResetTransform method resets the transformation matrix of this texture brush to the identity matrix. This means that no transformation takes place.
Syntax
Status ResetTransform();
Return value
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.
Remarks
Setting the transformation matrix to the identity matrix guarantees that no transformation is done. This method is often used to reset the transformation before making any adjustments (scaling, rotating, and so on) to it.
Examples
The following example creates a texture brush and sets the transformation of the brush. Next, the code uses the transformed brush to fill a rectangle. Then, the code resets the transformation of the brush and uses the untransformed brush to fill a rectangle.
VOID Example_ResetTransform(HDC hdc)
{
Graphics graphics(hdc);
// Create a texture brush, and set its transformation.
Image image(L"HouseAndTree.Gif");
TextureBrush textureBrush(&image);
textureBrush.RotateTransform(30);
// Fill a rectangle with the transformed texture brush.
graphics.FillRectangle(&textureBrush, 0, 0, 200, 100);
textureBrush.ResetTransform();
// Fill a rectangle with the texture brush (no transformation).
graphics.FillRectangle(&textureBrush, 250, 0, 200, 100);
}
Requirements
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 | gdiplusbrush.h (include Gdiplus.h) |
Library | Gdiplus.lib |
DLL | Gdiplus.dll |
See also
Coordinate Systems and Transformations
Filling a Shape with an Image Texture
TextureBrush::MultiplyTransform