[VB.NET]récupérer un objet System.Drawing.Image du Web
Salut à tous..
je récupère actuellement un objet image avec la procédure
Image.fromFile(path)
J'ai besoin de développer quelque chose de semblable qui serait du genre
fonction getImageFromUrl(url as string)
dim img as image
img=???
return img
end function
J'ai vu la fonction Image.fromStream(stream).. c'est peut etre une piste ??
Merci du coup de main
Bein mine de rien, c'est possible
Citation:
Envoyé par Matt Kleinwaks
System.Net.WebClient MyWebClient= new System.Net.WebClient();
//BYTE ARRAY HOLDS THE DATA
Byte [] ImageInBytes = MyWebClient.DownloadData("http://www.developpez.net/forums/images/logo16.gif");
//CREATE A MEMORY STREAM USING THE BYTES
System.IO.MemoryStream ImageStream =new System.IO.MemoryStream(ImageInBytes);
//CREATE A BITMAP FROM THE MEMORY STREAM
pictureBox1.Image = new System.Drawing.Bitmap(ImageStream);
Code de Matt Kleinwaks , j'ai testé et ca fonctionne à merveille