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

Font.Clone メソッド

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

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

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコードでは、Font複製作成し、そのフォントテキスト描画ます。

Public Sub Clone_Example(ByVal
 e As PaintEventArgs)

    ' Create a Font object.
    Dim myFont As New Font("Arial",
 16)

    ' Create a copy of myFont.
    Dim cloneFont As Font = CType(myFont.Clone(),
 Font)

    ' Use cloneFont to draw text to the screen.
    e.Graphics.DrawString("This is a cloned font",
 cloneFont, _
    Brushes.Black, 0, 0)
End Sub
public void Clone_Example(PaintEventArgs e)
{
    // Create a Font object.
    Font myFont = new Font("Arial", 16);
             
    // Create a copy of myFont.
    Font cloneFont = (Font)myFont.Clone();
             
    // Use cloneFont to draw text to the screen.
    e.Graphics.DrawString("This is a cloned font", cloneFont,
        Brushes.Black, 0, 0);
}
public:
   void Clone_Example( PaintEventArgs^ e )
   {
      // Create a Font object.
      System::Drawing::Font^ myFont = gcnew System::Drawing::Font( "Arial",16
 );

      // Create a copy of myFont.
      System::Drawing::Font^ cloneFont = dynamic_cast<System::Drawing::Font^>(myFont->Clone());

      // Use cloneFont to draw text to the screen.
      e->Graphics->DrawString( "This is a cloned font", cloneFont,
 Brushes::Black, 0, 0 );
   }
public void Clone_Example(PaintEventArgs e)
 
{
     // Create a Font object.
     Font myFont =  new Font("Arial", 16);
     
     // Create a copy of myFont.
     Font cloneFont = (Font)myFont.Clone();
     
     // Use cloneFont to draw text to the screen.
     e.get_Graphics().DrawString("This is a cloned font", cloneFont,
        Brushes.get_Black(), 0, 0);
 } //Clone_Example
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS