How to embed dynamic generated image into HTML?

Discussion in 'ASP .Net' started by Olav Tollefsen, Mar 1, 2004.

  1. I have som code that dynamically generates an image and writes it back to
    the browser from an .aspx codebehind file like this:

    System.Drawing.Image image;
    image = GenerateImage();
    Response.ContentType = "image/jpeg";
    image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);

    This works fine, but how can I use this image as a source for an server side
    Image control defined in my .aspx file?

    Olav
     
    Olav Tollefsen, Mar 1, 2004
    #1
    1. Advertising

  2. Did you try setting the source of the image tag to the ASPX page that
    generates the image.

    "Olav Tollefsen" <> wrote in message
    news:%23nCMd60$...
    > I have som code that dynamically generates an image and writes it back to
    > the browser from an .aspx codebehind file like this:
    >
    > System.Drawing.Image image;
    > image = GenerateImage();
    > Response.ContentType = "image/jpeg";
    > image.Save(Response.OutputStream,

    System.Drawing.Imaging.ImageFormat.Jpeg);
    >
    > This works fine, but how can I use this image as a source for an server

    side
    > Image control defined in my .aspx file?
    >
    > Olav
    >
    >
     
    Peter Rilling, Mar 1, 2004
    #2
    1. Advertising

  3. So, I can't do it from a single page?

    Olav

    "Peter Rilling" <> wrote in message
    news:#DmyES1$...
    > Did you try setting the source of the image tag to the ASPX page that
    > generates the image.
    >
    > "Olav Tollefsen" <> wrote in message
    > news:%23nCMd60$...
    > > I have som code that dynamically generates an image and writes it back

    to
    > > the browser from an .aspx codebehind file like this:
    > >
    > > System.Drawing.Image image;
    > > image = GenerateImage();
    > > Response.ContentType = "image/jpeg";
    > > image.Save(Response.OutputStream,

    > System.Drawing.Imaging.ImageFormat.Jpeg);
    > >
    > > This works fine, but how can I use this image as a source for an server

    > side
    > > Image control defined in my .aspx file?
    > >
    > > Olav
    > >
    > >

    >
    >
     
    Olav Tollefsen, Mar 1, 2004
    #3
    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. John
    Replies:
    2
    Views:
    1,162
  2. Big Dave
    Replies:
    0
    Views:
    739
    Big Dave
    Mar 10, 2005
  3. NarpatSingh
    Replies:
    0
    Views:
    836
    NarpatSingh
    Jan 17, 2007
  4. yukijocelyn

    Embed ".html" file into ".aspx" file

    yukijocelyn, Aug 6, 2007, in forum: .NET
    Replies:
    0
    Views:
    1,974
    yukijocelyn
    Aug 6, 2007
  5. Mark123
    Replies:
    0
    Views:
    708
    Mark123
    Sep 2, 2008
Loading...

Share This Page