次の方法で共有


Graphics::ResetTransform メソッド (gdiplusgraphics.h)

Graphics::ResetTransform メソッドは、この Graphics オブジェクトのワールド変換行列を ID 行列に設定します。

構文

Status ResetTransform();

戻り値

種類: 状態

メソッドが成功した場合は、 Status 列挙の要素である Ok を返します。

メソッドが失敗した場合は、 Status 列挙体の他の要素のいずれかを返します。

注釈

ID マトリックスは、何も行わない変換を表します。 Graphics オブジェクトのワールド変換行列が ID 行列の場合、その Graphics オブジェクトによって描画された項目にワールド変換は適用されません。

次の使用例は 、Graphics オブジェクトのワールド変換を 45 度回転に設定し、四角形を描画します。 このコードでは、Graphics オブジェクトの ResetTransform メソッドを呼び出し、2 つ目の四角形を描画します。 2 番目の四角形には回転変換は適用されません。

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

   // Rotate the transformation and draw a rectangle.
   graphics.RotateTransform(45.0f);
   Pen blackPen(Color(255, 0, 0, 0));
   graphics.DrawRectangle(&blackPen, 100, 0, 100, 50);

   // Reset the transformation to identity, and draw a second rectangle.
   graphics.ResetTransform();
   Pen redPen(Color(255, 255, 0, 0));
   graphics.DrawRectangle(&redPen, 110, 0, 100, 50);
}

要件

要件
サポートされている最小のクライアント Windows XP、Windows 2000 Professional [デスクトップ アプリのみ]
サポートされている最小のサーバー Windows 2000 Server [デスクトップ アプリのみ]
対象プラットフォーム Windows
ヘッダー gdiplusgraphics.h (Gdiplus.h を含む)
Library Gdiplus.lib
[DLL] Gdiplus.dll

関連項目

座標系と変換

グラフィックス

Graphics::GetTransform

Graphics::MultiplyTransform

Graphics::RotateTransform

Graphics::ScaleTransform

Graphics::SetTransform

Graphics::TransformPoints

Graphics::TranslateTransform

マトリックス

MatrixOrder

変換