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

PathGradientBrush::ScaleTransform メソッドは、このブラシの現在の変換行列をそれ自体とスケーリング マトリックスの積で更新します。

構文

Status ScaleTransform(
  [in] REAL        sx,
  [in] REAL        sy,
  [in] MatrixOrder order
);

パラメーター

[in] sx

種類: REAL

水平スケールファクターを指定する実数。

[in] sy

種類: REAL

垂直スケール係数を指定する実数。

[in] order

種類: MatrixOrder

省略可能。 乗算の順序を指定する MatrixOrder 列挙体の要素。 MatrixOrderPrepend は、スケーリング マトリックスが左側にあることを指定し、 MatrixOrderAppend はスケーリング マトリックスが右側にあることを指定します。 既定値は MatrixOrderPrepend です

戻り値

種類: 状態

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

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

解説

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

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

VOID Example_ScaleTransform(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.TranslateTransform(50.0f, 40.0f);               // translate
   pthGrBrush.ScaleTransform(3.0f, 2.0f, MatrixOrderAppend);  // then scale

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

PathGradientBrush::TranslateTransform

変換