hello every one. am trying to create Image from byte array in my page. First i create the image by System.Drawing.Image then am trying to convert

System.Drawing.Image

to

System.Web.UI.WebControls.Image

. but the compiler says "Cannot convert type 'System.Drawing.Image' to 'System.Web.UI.WebControls.Image'". So any one please help me.Thxs.

Hi,

System.Drawing.Image is an image (store as byte array in memory) where as System.Web.UI.WebControls.Image is a asp.net server control. Both are completely different and you cannot simply convert this. What are you trying to achieve?

You can write a http handler in asp.net which writes the bytes of array to response stream. You can use this http handler like a path to display the image in an asp.net image control. Check the following link.

Http Handlers to handle Images

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.