Reputation: 41158
I can't seem to convert it. Any help?
Upvotes: 1
Views: 11560
Reputation: 158319
They are two completely different objects:
System.Web.UI.WebControls.Image
is a control that has the ability to render HTML which will make the browser download and display an appointed imageSystem.Drawing.Image
is a class that has the ability to load an image into memory for manipulating it, or to display it in a control (but not the web image control).So unfortunately there is no way you can convert a System.Web.UI.WebControls.Image
to a System.Drawing.Image
; it doesn't even touch the image data.
Upvotes: 5
Reputation: 24606
System.Web.UI.WebControls.Image is merely a container for any valid image file specified by the ImageUrl property. If you would like to take the image at the ImageUrl and convert it to a System.Drawing.Image you can call System.Drawing.Image.ImageFromFile("path/to/image")
.
Upvotes: 0