voila tout est dans le titre convertir une System.Drawing.Image en System.Drawing.Icon
merci d'avance
Version imprimable
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'aiderCitation:
L'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:
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:
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
bah je v voir ca merci
Et un petit Tag Résolu, un :)