How to convert Image to byte [] in C#?

  • Thread starter Thread starter Frank Nero
  • Start date Start date
F

Frank Nero

I am trying to write an image to output stream, but can not figure out how
to convert
System.Web.UI.WebControls.Image

to byte [].


Please give me some hint.

Thanks,

Frank
 
Hi Frank,

The thing is that WebControls.Image does not store the image data, just a
link to where the real image is.

What you can do is using WebRequest to get the image from the URL from
Image.ImageUrl then you can save the image from the stream.

Cheers,
 
Back
Top