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

PathGradientBrush::GetWrapMode メソッドは、このパス グラデーション ブラシに現在設定されているラップ モードを取得します。

構文

WrapMode GetWrapMode();

戻り値

種類: WrapMode

このメソッドは、このパス グラデーション ブラシに現在設定されているラップ モードを示す WrapMode 列挙体の要素を返します。

解説

パス グラデーション ブラシの外接する四角形は、ブラシの境界パスを囲む最小の四角形です。 パス グラデーション ブラシを使用して外接する四角形を塗りつぶすと、境界パス内の領域のみが塗りつぶされます。 外接する四角形内の境界パスの外側の領域は塗りつぶされません。

パス グラデーション ブラシの既定のラップ モードは WrapModeClamp です。これは、ブラシの外接する四角形の外側に描画が行われないことを示します。 他のすべての折り返しモードは、ブラシの外接する四角形の外側の領域がタイル化されることを示します。 各タイルは、外接する四角形内の塗りつぶされたパスのコピー (場合によっては反転) です。

例

次の例では、三角形のパスに基づいて PathGradientBrush オブジェクトを作成します。 このコードでは、PathGradientBrush オブジェクトの PathGradientBrush::SetWrapMode メソッドを呼び出して、ラップ モードを WrapModeTileFlipX に設定します。 次に、 PathGradientBrush オブジェクトの PathGradientBrush::GetWrapMode メソッドを呼び出して 、 ブラシのラップ モードを取得します。 取得したラップ モードが WrapModeTileFlipX の場合、コードは FillRectangle を呼び出して、パス グラデーション ブラシで大きな領域をタイル化します。

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

   // Create a path gradient brush based on an array of points,
   // and set its wrap mode.
   Point points[] = {
      Point(0, 0), 
      Point(100, 0), 
      Point(100, 100)};

   Color colors[] = {
      Color(255, 255, 0, 0),   // red
      Color(255, 0, 0, 255),   // blue
      Color(255, 0, 255, 0)};  // green

   INT count = 3;

   PathGradientBrush pthGrBrush(points, 3);
   pthGrBrush.SetSurroundColors(colors, &count);
   pthGrBrush.SetWrapMode(WrapModeTileFlipX);

   // Obtain information about the path gradient brush.
   WrapMode wrapMode; 
   wrapMode = pthGrBrush.GetWrapMode();

   if(wrapMode == WrapModeTileFlipX)
         graphics.FillRectangle(&pthGrBrush, 0, 0, 800, 800);
}

要件

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

関連項目

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

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

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

PathGradientBrush

PathGradientBrush::SetWrapMode

図形と画像のタイリング