voila tout est dans le titre convertir une System.Drawing.Image en System.Drawing.Icon
merci d'avance
voila tout est dans le titre convertir une System.Drawing.Image en System.Drawing.Icon
merci d'avance
voila ce que j'ai trouve sur mon msdn de mon ordi
j'espere que ca peut d'aiderL'exemple suivant est destiné à une utilisation avec Windows Forms et nécessite PaintEventArgs e, qui est un paramètre du gestionnaire d'événements Paint. Le code effectue les opérations suivantes :
Il crée un objet Bitmap.
Dessine l'objet à l'écran.
Obtient un handle d'icône pour l'objet Bitmap.
Effectue une opération à l'aide du handle.
[Visual Basic]
[C#]
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 Public Sub GetHicon_Example(e As PaintEventArgs) ' Create a Bitmap object from an image file. Dim myBitmap As New Bitmap("Grapes.jpg") ' Draw myBitmap to the screen. e.Graphics.DrawImage(myBitmap, 0, 0) ' Get an Hicon for myBitmap. Dim HIcon As IntPtr = myBitmap.GetHicon() End Sub
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 public void GetHicon_Example(PaintEventArgs e) { // Create a Bitmap object from an image file. Bitmap myBitmap = new Bitmap("Grapes.jpg"); // Draw myBitmap to the screen. e.Graphics.DrawImage(myBitmap, 0, 0); // Get an Hicon for myBitmap. IntPtr Hicon = myBitmap.GetHicon(); // Do something with Hicon. // ... }
voila le lien lsdn france
http://msdn.microsoft.com/library/fr...hicontopic.asp
Et un petit Tag Résolu, un![]()
Thomas LEBRUN: MCAD.NET, MCTS (Win et Web), MCPD(Win et Web) & Microsoft MVP Client Application Development
WPF par la pratique, mon livre sur WPF ! (également disponible ici ou là)
A la découverte de .NET
Partager