TextureBrush::ResetTransform 方法 (gdiplusbrush.h)

TextureBrush::ResetTransform 方法會將這個紋理筆刷的轉換矩陣重設為識別矩陣。 這表示不會進行任何轉換。

Syntax

Status ResetTransform();

傳回值

類型: 狀態

如果方法成功,它會傳回 Ok,這是 Status 列舉的元素。

如果方法失敗,它會傳回 Status 列舉的其中一個其他元素。

備註

將轉換矩陣設定為識別矩陣可確保不會完成任何轉換。 此方法通常用來重設轉換,再進行任何調整 (調整、旋轉等等) 。

範例

下列範例會建立紋理筆刷,並設定筆刷的轉換。 接下來,程式代碼會使用已轉換的筆刷來填滿矩形。 然後,程式代碼會重設筆刷的轉換,並使用未轉換的筆刷填滿矩形。

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);
}

規格需求

需求
最低支援的用戶端 Windows XP、Windows 2000 Professional [僅限傳統型應用程式]
最低支援的伺服器 Windows 2000 Server [僅限傳統型應用程式]
目標平台 Windows
標頭 gdiplusbrush.h (包含 Gdiplus.h)
程式庫 Gdiplus.lib
Dll Gdiplus.dll

另請參閱

筆刷和填滿的圖形

座標系統和轉換

使用影像紋理填滿圖形

映像

矩陣

MatrixOrder

TextureBrush

TextureBrush::GetTransform

TextureBrush::MultiplyTransform

TextureBrush::RotateTransform

TextureBrush::ScaleTransform

TextureBrush::SetTransform

TextureBrush::TranslateTransform

轉換