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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top