GraphicsPath.Widenとは? わかりやすく解説

GraphicsPath.Widen メソッド (Pen)

パスに追加のアウトラインを追加します。

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

解説解説

このメソッドは、この GraphicsPath の元の線の周りにアウトラインを作成します。既存の線と新しいアウトライン間の距離として、Widen の呼び出し時に使用される Pen の幅が使用されます。線の間の空間を塗りつぶす場合は、DrawPath ではなく FillPath を使用する必要があります。

使用例使用例
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間

GraphicsPath.Widen メソッド (Pen, Matrix, Single)

この GraphicsPath を、指定されたペンでこのパスを描画するときに塗りつぶされる領域を囲む曲線に置換します。

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

解説解説

このメソッドは、この GraphicsPath の元の線の周りにアウトラインを作成します。既存の線と新しいアウトライン間の距離として、Widen の呼び出し時に使用される Pen の幅が使用されます。線の間の空間を塗りつぶす場合は、DrawPath ではなく FillPath を使用する必要があります。

使用例使用例

次のコード例は、Windows フォームでの使用を意図してデザインされており、OnPaint イベント オブジェクトである PaintEventArgse が必要です。このコードは次のアクションを実行します。

2 番目の描画では DrawPath ではなく FillPath が使用されるため、描画された図形はアウトラインが塗りつぶされます。

Public Sub WidenExample(ByVal
 e As PaintEventArgs)
    Dim myPath As New GraphicsPath
    myPath.AddEllipse(0, 0, 100, 100)
    myPath.AddEllipse(100, 0, 100, 100)
    e.Graphics.DrawPath(Pens.Black, myPath)
    Dim widenPen As New
 Pen(Color.Black, 10)
    Dim widenMatrix As New
 Matrix
    widenMatrix.Translate(50, 50)
    myPath.Widen(widenPen, widenMatrix, 1.0F)
    ' Sets tension for curves.
    e.Graphics.FillPath(New SolidBrush(Color.Red), myPath)
End Sub
private void WidenExample(PaintEventArgs e)
{
             
    // Create a path and add two ellipses.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddEllipse(0, 0, 100, 100);
    myPath.AddEllipse(100, 0, 100, 100);
             
    // Draw the original ellipses to the screen in black.
    e.Graphics.DrawPath(Pens.Black, myPath);
             
    // Widen the path.
    Pen widenPen = new Pen(Color.Black, 10);
    Matrix widenMatrix = new Matrix();
    widenMatrix.Translate(50, 50);
    myPath.Widen(widenPen, widenMatrix, 1.0f);
             
    // Draw the widened path to the screen in red.
    e.Graphics.FillPath(new SolidBrush(Color.Red), myPath);
}
private:
   void WidenExample( PaintEventArgs^ e )
   {
      // Create a path and add two ellipses.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddEllipse( 0, 0, 100, 100 );
      myPath->AddEllipse( 100, 0, 100, 100 );

      // Draw the original ellipses to the screen in black.
      e->Graphics->DrawPath( Pens::Black, myPath );

      // Widen the path.
      Pen^ widenPen = gcnew Pen( Color::Black,10.0f );
      Matrix^ widenMatrix = gcnew Matrix;
      widenMatrix->Translate( 50, 50 );
      myPath->Widen( widenPen, widenMatrix, 1.0f );

      // Draw the widened path to the screen in red.
      e->Graphics->FillPath( gcnew SolidBrush( Color::Red ), myPath );
   }
private void WidenExample(PaintEventArgs e)
{
    // Create a path and add two ellipses.
    GraphicsPath myPath = new GraphicsPath();

    myPath.AddEllipse(0, 0, 100, 100);
    myPath.AddEllipse(100, 0, 100, 100);

    // Draw the original ellipses to the screen in black.
    e.get_Graphics().DrawPath(Pens.get_Black(), myPath);

    // Widen the path.
    Pen widenPen = new Pen(Color.get_Black(), 10);
    Matrix widenMatrix = new Matrix();

    widenMatrix.Translate(50, 50);
    myPath.Widen(widenPen, widenMatrix, 1);

    // Draw the widened path to the screen in red.
    e.get_Graphics().FillPath(new SolidBrush(Color.get_Red()),
 myPath);
} //WidenExample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間

GraphicsPath.Widen メソッド

このパスを、指定されたペンでこのパスを描画するときに塗りつぶされる領域を囲む曲線に置換します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
GraphicsPath.Widen (Pen) パスに追加のアウトラインを追加します。
GraphicsPath.Widen (Pen, Matrix) GraphicsPath に別のアウトラインを追加します。
GraphicsPath.Widen (Pen, Matrix, Single) この GraphicsPath を、指定されたペンでこのパスを描画するときに塗りつぶされる領域を囲む曲線に置換します。
参照参照

関連項目

GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間

GraphicsPath.Widen メソッド (Pen, Matrix)

GraphicsPath に別のアウトラインを追加します。

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

解説解説

このメソッドは、この GraphicsPath の元の線の周りにアウトラインを作成します。既存の線と新しいアウトライン間の距離として、Widen の呼び出し時に使用される Pen の幅が使用されます。線の間の空間を塗りつぶす場合は、DrawPath ではなく FillPath を使用する必要があります。

使用例使用例
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「GraphicsPath.Widen」の関連用語

GraphicsPath.Widenのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



GraphicsPath.Widenのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS