Pen::SetTransform メソッド (gdipluspen.h)

Pen::SetTransform メソッドは、この Pen オブジェクトのワールド変換を設定します。

構文

Status SetTransform(
  [in] const Matrix *matrix
);

パラメーター

[in] matrix

型: const Matrix*

ワールド変換を指定する Matrix オブジェクトへのポインター。

戻り値

種類: 状態

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

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

解説

このメソッドは 、Matrix オブジェクトの変換部分を無視します。

次の例では、スケール マトリックスと Pen オブジェクトを作成し、四角形を描画します。 次に、マトリックスでペンをスケーリングし、2 番目の四角形を描画します。

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

   Matrix matrix(20, 0, 0, 10, 0, 0);  // scale

   // Create a pen, and use it to draw a rectangle.
   Pen pen(Color(255, 0, 0, 255), 2);
   graphics.DrawRectangle(&pen, 10, 50, 150, 100);

   // Scale the pen width by a factor of 20 in the horizontal 
   // direction and a factor of 10 in the vertical direction.
   pen.SetTransform(&matrix);

   // Draw a rectangle with the transformed pen.
   graphics.DrawRectangle(&pen, 200, 50, 150, 100);
}

要件

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

関連項目

座標系と変換

マトリックス

ペン

Pen::GetTransform

Pen::MultiplyTransform

Pen::ResetTransform

Pen::RotateTransform

Pen::ScaleTransform

変換