Font.Clone メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
この Font の同一コピーを作成します。
public:
virtual System::Object ^ Clone();
public object Clone ();
abstract member Clone : unit -> obj
override this.Clone : unit -> obj
Public Function Clone () As Object
戻り値
このメソッドが作成し、Object としてキャストされる Font。
実装
例
次のコード例は、Windows フォームで使用するように設計されており、イベント ハンドラーのPaintパラメーターである が必要PaintEventArgse
です。 コードは を Font 複製し、そのフォントでテキストを描画します。
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.Graphics.DrawString("This is a cloned font", cloneFont,
Brushes.Black, 0, 0);
}
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
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示