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

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

構文

Status TranslateTransform(
  [in] REAL        dx,
  [in] REAL        dy,
  [in] MatrixOrder order
);

パラメーター

[in] dx

種類: REAL

平行移動の水平コンポーネントを指定する実数。

[in] dy

種類: REAL

平行移動の垂直コンポーネントを指定する実数。

[in] order

種類: MatrixOrder

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

戻り値

種類: 状態

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

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

注釈

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

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

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

   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);
   pthGrBrush.TranslateTransform(100.0f, 50.0f, MatrixOrderAppend);

   // 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::RotateTransform

PathGradientBrush::ScaleTransform

PathGradientBrush::SetTransform

変換