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

PathGradientBrush::SetBlendBellShape メソッドは、このパス グラデーション ブラシのブレンドシェイプを設定します。

構文

Status SetBlendBellShape(
  [in]           REAL focus,
  [in, optional] REAL scale
);

パラメーター

[in] focus

種類: REAL

中心の色が最も高い強度になる場所を指定する実数。 この数値は、0 ~ 1 の範囲である必要があります。

[in, optional] scale

種類: REAL

省略可能。 境界の色とブレンドされる中心の色の最大強度を指定する実数。 この数値は、0 ~ 1 の範囲である必要があります。 既定値は 1 です。

戻り値

種類: 状態

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

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

注釈

既定では、パス グラデーションの境界から中心点に移動すると、色は境界の色から中心の色に徐々に変化します。 PathGradientBrush::SetBlendBellShape メソッドを呼び出すことで、境界と中央の色の配置とブレンドをカスタマイズできます。

次の例では、楕円に基づいて PathGradientBrush オブジェクトを作成します。 このコードは、PathGradientBrush オブジェクトの PathGradientBrush::SetBlendBellShape メソッドを呼び出し、フォーカスを 0.2、スケールを 0.7 に渡します。 次に、パス グラデーション ブラシを使用して、楕円を含む四角形を描画します。

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

   // Create a path that consists of a single ellipse.
   GraphicsPath path;
   path.AddEllipse(0, 0, 200, 100);

   // Use the path to construct a brush.
   PathGradientBrush pthGrBrush(&path);

   // Set the color at the center of the path to red.
   pthGrBrush.SetCenterColor(Color(255, 255, 0, 0));

   // Set the color along the entire boundary of the path to blue.
   Color colors[] = {Color(255, 0, 0, 255)};
   INT count = 1;
   pthGrBrush.SetSurroundColors(colors, &count);

   pthGrBrush.SetBlendBellShape(0.2f, 0.7f);

   // The color is blue on the boundary and at the center.
   // At points that are 20 percent of the way from the boundary to the
   // center, the color is 70 percent red and 30 percent blue.

   graphics.FillRectangle(&pthGrBrush, 0, 0, 300, 300); 
}

要件

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

こちらもご覧ください

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

Color

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

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

Graphicspath

PathGradientBrush

PathGradientBrush::GetBlend

PathGradientBrush::GetBlendCount

PathGradientBrush::SetBlend

PathGradientBrush::SetBlendTriangularShape