PathGradientBrush::RotateTransform メソッド (gdipluspath.h)

PathGradientBrush::RotateTransform メソッドは、このブラシの現在の変換行列をそれ自体と回転行列の積で更新します。

構文

Status RotateTransform(
  [in] REAL        angle,
  [in] MatrixOrder order
);

パラメーター

[in] angle

種類: REAL

回転角度を度単位で指定する実数。

[in] order

種類: MatrixOrder

省略可能。 乗算の順序を指定する MatrixOrder 列挙体の要素。 MatrixOrderPrepend は回転行列が左側にあることを指定し、 MatrixOrderAppend は回転行列が右側にあることを指定します。 既定値は MatrixOrderPrepend です

戻り値

種類: 状態

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

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

解説

1 つの 3 ×3 行列は、アフィン変換の任意のシーケンスを格納できます。 複数の 3 ×3 個の行列があり、それぞれがアフィン変換を表す場合、それらの行列の積は、変換のシーケンス全体を表す単一の 3 ×3 行列です。 その製品によって表される変換は、複合変換と呼ばれます。 たとえば、行列 T が平行移動を表し、行列 R が回転を表すとします。 行列 M が積 TR の場合、行列 M は複合変換を表します。最初に平行移動し、次に回転します。

次の例では、三角形のパスに基づいて PathGradientBrush オブジェクトを作成します。 PathGradientBrush オブジェクトの PathGradientBrush::ScaleTransform メソッドと PathGradientBrush::RotateTransform メソッドの呼び出しは、ブラシの変換行列の要素を設定して、複合変換 (最初のスケール、次に回転) を表します。 このコードでは、パス グラデーション ブラシを 2 回使用して四角形を描画します。変換が設定される前に 1 回、変換が設定された後に 1 回です。

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

   // Create a path gradient brush based on an array of points.
   Point pts[] = {Point(0, 0), Point(50, 0), Point(50, 50)};
   PathGradientBrush pthGrBrush(pts, 3);

   // Fill an area with the path gradient brush (no transformation).
   graphics.FillRectangle(&pthGrBrush, 0, 0, 500, 500);

   pthGrBrush.ScaleTransform(3.0f, 1.0f);                 // first scale
   pthGrBrush.RotateTransform(60.0f, MatrixOrderAppend);  // then rotate

   // Fill the same area with the transformed path gradient brush.
   graphics.FillRectangle(&pthGrBrush, 0, 0, 500, 500);
}

要件

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

関連項目

ブラシと図形の塗りつぶし

パス グラデーションの作成

色のグラデーションで図形を塗りつぶす

マトリックス

変換の行列表現

MatrixOrder

PathGradientBrush

PathGradientBrush::GetTransform

PathGradientBrush::MultiplyTransform

PathGradientBrush::ResetTransform

PathGradientBrush::ScaleTransform

PathGradientBrush::SetTransform

PathGradientBrush::TranslateTransform

変換