Image rendered from a custom control

Discussion in 'ASP .Net Web Controls' started by bobben, Feb 4, 2004.

  1. bobben

    bobben Guest

    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

    Anyone knows any good techniques?

    bobben, Feb 4, 2004
    1. Advertisements

  2. bobben

    bobben Guest

    I figured it out....sort of.... It seems that this can be solved using the
    <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!
    bobben, Feb 6, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.