Assembly : System.Drawing (dans system.drawing.dll)
Syntaxe<SerializableAttribute> _ Public NotInheritable Class Icon Inherits MarshalByRefObject Implements ISerializable, ICloneable, IDisposable
Dim instance As Icon
[SerializableAttribute] public sealed class Icon : MarshalByRefObject, ISerializable, ICloneable, IDisposable
[SerializableAttribute] public ref class Icon sealed : public MarshalByRefObject, ISerializable, ICloneable, IDisposable
/** @attribute SerializableAttribute() */ public final class Icon extends MarshalByRefObject implements ISerializable, ICloneable, IDisposable
SerializableAttribute public final class Icon extends MarshalByRefObject implements ISerializable, ICloneable, IDisposable
ExempleL'exemple de code suivant illustre l'utilisation de la méthode ToBitmap. Cet exemple est conçu pour être utilisé avec Windows Forms. Créez un formulaire et collez le code suivant dans ce formulaire. Appelez la méthode IconToBitmap dans le gestionnaire d'événements Paint du formulaire en passant e comme 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)); }
private: void IconToBitmap( PaintEventArgs^ e ) { // Construct an Icon. System::Drawing::Icon^ icon1 = gcnew System::Drawing::Icon( SystemIcons::Exclamation,40,40 ); // Call ToBitmap to convert it. Bitmap^ bmp = icon1->ToBitmap(); // Draw the bitmap. e->Graphics->DrawImage( bmp, Point(30,30) ); }
private void IconToBitmap(PaintEventArgs e) { // Construct an Icon. Icon icon1 = new Icon(SystemIcons.get_Exclamation(), 40, 40); // Call ToBitmap to convert it. Bitmap bmp = icon1.ToBitmap(); // Draw the bitmap. e.get_Graphics().DrawImage(bmp, new Point(30, 30)); } //IconToBitmap
Sécurité des threads
Plates-formesWindows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile pour Pocket PC, Windows Mobile pour Smartphone, Windows Server 2003, Windows XP Édition Media Center, Windows XP Professionnel Édition x64, Windows XP SP2, Windows XP Starter Edition
Le .NET Framework ne prend pas en charge toutes les versions de chaque plate-forme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise.
Informations de version
Outils (masquer)
S'enregistrer
Liste des Membres
Qui est en ligne?
FAQ