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

Pen.Clone メソッド

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

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

使用例使用例

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

Public Sub Clone_Example(ByVal
 e As PaintEventArgs)

    ' Create a Pen object.
    Dim myPen As New Pen(Color.Black,
 5)

    ' Clone myPen.
    Dim clonePen As Pen = CType(myPen.Clone(),
 Pen)

    ' Draw a line with clonePen.
    e.Graphics.DrawLine(clonePen, 0, 0, 100, 100)
End Sub
public void Clone_Example(PaintEventArgs e)
{
             
    // Create a Pen object.
    Pen myPen = new Pen(Color.Black, 5);
             
    // Clone myPen.
    Pen clonePen = (Pen)myPen.Clone();
             
    // Draw a line with clonePen.
    e.Graphics.DrawLine(clonePen, 0, 0, 100, 100);
}
public:
   void Clone_Example( PaintEventArgs^ e )
   {
      
      // Create a Pen object.
      Pen^ myPen = gcnew Pen( Color::Black,5.0f );
      
      // Clone myPen.
      Pen^ clonePen = dynamic_cast<Pen^>(myPen->Clone());
      
      // Draw a line with clonePen.
      e->Graphics->DrawLine( clonePen, 0, 0, 100, 100 );
   }
public void Clone_Example(PaintEventArgs e)
{
    // Create a Pen object.
    Pen myPen = new Pen(Color.get_Black(), 5);

    // Clone myPen.
    Pen clonePen = ((Pen)(myPen.Clone()));

    // Draw a line with clonePen.
    e.get_Graphics().DrawLine(clonePen, 0, 0, 100, 100);
} //Clone_Example
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS