Icon クラス
アセンブリ: System.Drawing (system.drawing.dll 内)
構文
<SerializableAttribute> _ Public NotInheritable Class Icon Inherits MarshalByRefObject Implements ISerializable, ICloneable, IDisposable
[SerializableAttribute] public sealed class Icon : MarshalByRefObject, ISerializable, ICloneable, IDisposable
[SerializableAttribute] public ref class Icon sealed : public MarshalByRefObject, ISerializable, ICloneable, IDisposable
ToBitmap メソッドを使用する方法を次のコード例に示します。この例は、Windows フォームでの使用を意図してデザインされています。フォームを作成し、次のコードを貼り付けます。フォームの Paint イベント ハンドラで IconToBitmap メソッドを呼び出し、e を PaintEventArgs として渡します。
Private Sub IconToBitmap(ByVal e As PaintEventArgs) ' Construct an Icon. Dim icon1 As New Icon(SystemIcons.Exclamation, 40, 40) ' Call ToBitmap to convert it. Dim bmp As Bitmap = icon1.ToBitmap() ' Draw the bitmap. e.Graphics.DrawImage(bmp, New Point(30, 30)) End Sub
private void IconToBitmap(PaintEventArgs e) { // Construct an Icon. Icon icon1 = new Icon(SystemIcons.Exclamation, 40, 40); // Call ToBitmap to convert it. Bitmap bmp = icon1.ToBitmap(); // Draw the bitmap. e.Graphics.DrawImage(bmp, new Point(30, 30)); }
System.MarshalByRefObject
System.Drawing.Icon
プラットフォーム
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- Icon クラスのページへのリンク