GraphicsPath.Clone メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > GraphicsPath.Clone メソッドの意味・解説 

GraphicsPath.Clone メソッド

対象パス同一コピー作成します

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

使用例使用例

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

Clone メソッド呼び出しは、GraphicsPath としてキャストする必要があります

Public Sub CloneExample(ByVal
 e As PaintEventArgs)

    ' Set several markers in a path.
    Dim myPath As New GraphicsPath
    myPath.AddEllipse(0, 0, 100, 200)
    myPath.AddLine(New Point(100, 100), New
 Point(200, 100))
    Dim rect As New Rectangle(200,
 0, 100, 200)
    myPath.AddRectangle(rect)
    myPath.AddLine(New Point(250, 200), New
 Point(250, 300))

    ' Draw the path to the screen.
    Dim myPen As New Pen(Color.Black,
 2)
    e.Graphics.DrawPath(myPen, myPath)

    ' Clone a copy of myPath.
    Dim myPath2 As GraphicsPath = CType(myPath.Clone(),
 GraphicsPath)

    ' Draw the path to the screen.
    Dim myPen2 As New Pen(Color.Red,
 4)
    e.Graphics.DrawPath(myPen2, myPath2)
End Sub
private void CloneExample(PaintEventArgs e)
{
             
    // Set several markers in a path.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddEllipse(0, 0, 100, 200);
    myPath.AddLine(new Point(100, 100), new
 Point(200, 100));
    Rectangle rect = new Rectangle(200, 0, 100, 200);
    myPath.AddRectangle(rect);
    myPath.AddLine(new Point(250, 200), new
 Point(250, 300));
             
    // Draw the path to the screen.
    Pen myPen = new Pen(Color.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
             
    // Clone a copy of myPath.
    GraphicsPath myPath2 = (GraphicsPath)myPath.Clone();
             
    // Draw the path to the screen.
    Pen myPen2 = new Pen(Color.Red, 4);
    e.Graphics.DrawPath(myPen2, myPath2);
}
private:
   void CloneExample( PaintEventArgs^ e )
   {
      // Set several markers in a path.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddEllipse( 0, 0, 100, 200 );
      myPath->AddLine( Point(100,100), Point(200,100) );
      Rectangle rect = Rectangle(200,0,100,200);
      myPath->AddRectangle( rect );
      myPath->AddLine( Point(250,200), Point(250,300) );

      // Draw the path to the screen.
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );
      e->Graphics->DrawPath( myPen, myPath );

      // Clone a copy of myPath.
      GraphicsPath^ myPath2 = dynamic_cast<GraphicsPath^>(myPath->Clone());

      // Draw the path to the screen.
      Pen^ myPen2 = gcnew Pen( Color::Red,4.0f );
      e->Graphics->DrawPath( myPen2, myPath2 );
   }
private void CloneExample(PaintEventArgs e)
{
    // Set several markers in a path.
    GraphicsPath myPath = new GraphicsPath();

    myPath.AddEllipse(0, 0, 100, 200);
    myPath.AddLine(new Point(100, 100), new
 Point(200, 100));

    Rectangle rect = new Rectangle(200, 0, 100, 200);

    myPath.AddRectangle(rect);
    myPath.AddLine(new Point(250, 200), new
 Point(250, 300));

    // Draw the path to the screen.
    Pen myPen = new Pen(Color.get_Black(), 2);

    e.get_Graphics().DrawPath(myPen, myPath);

    // Clone a copy of myPath.
    GraphicsPath myPath2 = ((GraphicsPath)(myPath.Clone()));

    // Draw the path to the screen.
    Pen myPen2 = new Pen(Color.get_Red(), 4);

    e.get_Graphics().DrawPath(myPen2, myPath2);
} //CloneExample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からGraphicsPath.Clone メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からGraphicsPath.Clone メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からGraphicsPath.Clone メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

GraphicsPath.Clone メソッドのお隣キーワード
検索ランキング

   

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



GraphicsPath.Clone メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS