Font.Clone メソッド
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As Font Dim returnValue As Object returnValue = instance.Clone
このメソッドが作成し、Object としてキャストされる Font。

次の例は、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

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Font.Clone メソッドのページへのリンク