Image rendered from a custom control

B

bobben

Does anyone know if it is possible to emit a imagebutton with a bitmap
within a custom control.
In other words; I want the custom control to be selfcontained, and not have
to rely on a aspx page to be able to display an imagebutton with a
dynamically stored image. (From a database or loaded from a resource file.)

All I can find is this:

(...)
MemoryStream tempStream = new MemoryStream();

bitmap.Save(Page.Response.OutputStream,ImageFormat.Gif );

But then I am relying on a separate aspx page as a source for my
imagebutton.

Anyone knows any good techniques?

Børge
 
B

bobben

I figured it out....sort of.... It seems that this can be solved using the
tag:
<img src="data:image/gif;base64,'.<base64encodedImageString>.'

This is however only supported by 4.01 compliant browsers (or something
like that) AND IE is not compliant.

Great! I see that this is supported in ASP.Net 2.0 with the Webresource
feature.... just have to wait.



Thanks anyway!
Børge
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top