GraphicsPath::IsOutlineVisible(constPointF&,constPen*,constGraphics*) メソッド (gdipluspath.h)

GraphicsPath::IsOutlineVisible メソッドは、指定した Graphics オブジェクトと指定したペンでパスを描画するときに、指定したポイントがこのパスの輪郭に触れるかどうかを決定します。

構文

BOOL IsOutlineVisible(
  const PointF & point,
  const Pen      *pen,
  const Graphics *g
);

パラメーター

point

テストするポイントへの参照。

pen

Pen オブジェクトへのポインター。 このメソッドは、このペンによって描画されるパス アウトラインにテスト ポイントが接触するかどうかを決定します。 幅の広いペンで描画されたアウトラインに、狭いペンで描画されたアウトラインにタッチする点が多くなります。

g

省略可能。 ワールドからデバイスへの変換を指定する Graphics オブジェクトへのポインター。 このパラメーターの値が NULL の場合、テストはワールド座標で行われます。それ以外の場合、テストはデバイス座標で行われます。 既定値は NULL です。

戻り値

テスト ポイントがこのパスのアウトラインに触れると、このメソッドは TRUE を返します。それ以外の場合は、 FALSE を返します。

解説

次の例では、楕円のパスを作成し、そのパスを広い黄色のペンで描画します。 次に、コードは配列内の各ポイントをテストして、パスの (黄色のワイド ペンで描画される) 点がアウトラインに触れるかどうかを確認します。 アウトラインに触れるポイントは緑色に塗られ、輪郭に触れない点は赤で塗りつぶされます。

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

   INT j;
   Pen yellowPen(Color(255, 255, 255, 0), 20);
   SolidBrush brush(Color(255, 255, 0,  0));

   // Create and draw a path.
   GraphicsPath path;
   path.AddEllipse(50, 50, 200, 100);
   graphics.DrawPath(&yellowPen, &path);

   // Create an array of three points, and determine whether each
   // point in the array touches the outline of the path.
   // If a point touches the outline, paint it green.
   // If a point does not touch the outline, paint it red.
   PointF[] = {
      PointF(230, 138),
      PointF(100, 120),
      PointF(150, 170)};

   for(j = 0; j <= 2; ++j)
   {
      if(path.IsOutlineVisible(points[j], &yellowPen, NULL))
         brush.SetColor(Color(255, 0, 255,  0));
      else
         brush.SetColor(Color(255, 255, 0,  0));

      graphics.FillEllipse(&brush, points[j].X - 3.0f, points[j].Y - 3.0f, 6.0f, 6.0f);
   }
}

Color(255, 255, 0,  0)Color(255, 255, 0,  0)

要件

   
Header gdipluspath.h

こちらもご覧ください

領域でのクリッピング

パスの作成および描画

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

グラフィックス

Graphicspath

IsOutlineVisible メソッド

IsVisible メソッド

パス

ペン

ペン、直線、および四角形

Pointf

ペンの幅と配置の設定