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
    imagebutton.

    Anyone knows any good techniques?

    Børge
     
    bobben, Feb 4, 2004
    #1
    1. Advertising

  2. bobben

    bobben Guest

    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

    "bobben" <> wrote in message
    news:...
    > 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
    >
    >
     
    bobben, Feb 6, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leeor Chernov
    Replies:
    2
    Views:
    809
    Leeor Chernov
    Oct 16, 2005
  2. Matt Sokol
    Replies:
    2
    Views:
    437
    Theo Tillotson
    Aug 7, 2003
  3. Cappy

    Repeater control in a rendered custom control

    Cappy, Jan 21, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    170
    Cappy
    Jan 21, 2004
  4. Rob Joosen

    Keep custom property-value in custom rendered control

    Rob Joosen, May 12, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    159
    Rob Joosen
    May 12, 2004
  5. TJ
    Replies:
    4
    Views:
    393
    Steven Cheng[MSFT]
    Apr 7, 2006
Loading...

Share This Page