GraphicsPath.Widen メソッド

定義

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

オーバーロード

Widen(Pen, Matrix)

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

Widen(Pen)

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

Widen(Pen, Matrix, Single)

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

Widen(Pen, Matrix)

ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs

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

public:
 void Widen(System::Drawing::Pen ^ pen, System::Drawing::Drawing2D::Matrix ^ matrix);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix matrix);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix? matrix);
member this.Widen : System.Drawing.Pen * System.Drawing.Drawing2D.Matrix -> unit
Public Sub Widen (pen As Pen, matrix As Matrix)

パラメーター

pen
Pen

パスの元のアウトラインと、このメソッドが作成する新しいアウトラインの間の幅を指定する Pen

matrix
Matrix

幅の拡張前にパスに適用する変換を指定する Matrix

例については、「Widen(Pen, Matrix, Single)」を参照してください。

注釈

このメソッドは、 の呼び出しWidenで使用される の幅と等しい既存の行と新しいアウトラインの間の距離を持つ、この GraphicsPath内の元の行のPen周りにアウトラインを作成します。 行間のスペースを埋める場合は、 ではなく を FillPath 使用する DrawPath必要があります。

適用対象

Widen(Pen)

ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs

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

public:
 void Widen(System::Drawing::Pen ^ pen);
public void Widen (System.Drawing.Pen pen);
member this.Widen : System.Drawing.Pen -> unit
Public Sub Widen (pen As Pen)

パラメーター

pen
Pen

パスの元のアウトラインと、このメソッドが作成する新しいアウトラインの間の幅を指定する Pen

例については、「Widen(Pen, Matrix, Single)」を参照してください。

注釈

このメソッドは、 の呼び出しWidenで使用される の幅と等しい既存の行と新しいアウトラインの間の距離を持つ、この GraphicsPath内の元の行のPen周りにアウトラインを作成します。 行間のスペースを埋める場合は、 ではなく を FillPath 使用する DrawPath必要があります。

適用対象

Widen(Pen, Matrix, Single)

ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs

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

public:
 void Widen(System::Drawing::Pen ^ pen, System::Drawing::Drawing2D::Matrix ^ matrix, float flatness);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix matrix, float flatness);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix? matrix, float flatness);
member this.Widen : System.Drawing.Pen * System.Drawing.Drawing2D.Matrix * single -> unit
Public Sub Widen (pen As Pen, matrix As Matrix, flatness As Single)

パラメーター

pen
Pen

パスの元のアウトラインと、このメソッドが作成する新しいアウトラインの間の幅を指定する Pen

matrix
Matrix

幅の拡張前にパスに適用する変換を指定する Matrix

flatness
Single

曲線の平坦度を指定する値。

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

  • パスを作成し、パスに 2 つの省略記号を追加します。

  • パスを黒で描画します。

  • パスを拡大します。

  • パスを赤で描画します。

2 番目のレンダリングでは の代わりに DrawPathが使用FillPathされるため、レンダリングされた図にはアウトラインが塗りつぶされていることに注意してください。

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.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);
}
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

注釈

このメソッドは、 の呼び出しWidenで使用される の幅と等しい既存の行と新しいアウトラインの間の距離を持つ、この GraphicsPath内の元の行のPen周りにアウトラインを作成します。 行間のスペースを埋める場合は、 ではなく を FillPath 使用する DrawPath必要があります。

適用対象