Saturday, March 31, 2012

System.Drawing.Image.FromFile from URL?

can i create a system.drawing.Image from a url. using
http://www.domain.com/image.jpg instead of c:\image.jpg. ?
thanks!No, but you can use the WebClient or WebRequest classes to bring the
bytes to the local computer and then create the Image obect.
HTH,
Scott
http://www.OdeToCode.com
On 18 Sep 2004 09:23:29 -0700, jcharth@.hotmail.com (Joseph) wrote:

>can i create a system.drawing.Image from a url. using
>http://www.domain.com/image.jpg instead of c:\image.jpg. ?
>thanks!
As scott mentioned, you do not have any method that can directly read the
image from URL.
Use webclient and read it into a byte[] using DownloadData
then you Image class to load it
Regards,
Hermit Dave
(http://hdave.blogspot.com)
"Joseph" <jcharth@.hotmail.com> wrote in message
news:2f2b8b0b.0409180823.2a6f2f18@.posting.google.com...
> can i create a system.drawing.Image from a url. using
> http://www.domain.com/image.jpg instead of c:\image.jpg. ?
> thanks!

0 comments:

Post a Comment