locked
a question about Response.OutputStream RRS feed

  • Question

  • User-1429075298 posted
    Hi:
    I want to use Response.OutputStream to display an image on my screen. I use bm.Save(Response.OutputStream, ImageFormat.Gif). Because my program is a poll system. So there is some text and some checkbox also needed to be displayed on the screen. But when I use outputstream. I can not find the text and checkbox. How can I display the dynamiclly created image in a designated area such as in a cell of a table? Please Help!!

    //-----
    Bitmap bm = new Bitmap(width, height); 
    Graphics g = Graphics.FromImage(bm);
    ......
    .....
    bm.Save(Response.OutputStream, ImageFormat.Gif);
    Tuesday, August 9, 2005 11:51 AM

All replies

  • User217889999 posted

    You can use your .aspx Web Form as the 'src' for an ordinary IMG Tag or an asp:image Web Control:

     

    <img src="myimageoutput.aspx?some_id_or_path_if_you_need_it=ValueToSend" />

    Tuesday, August 9, 2005 9:08 PM
  • User-1750044441 posted
    Just to go one step further from the previous post, you have two pages.  One page has your form, checkbox, textbox and an image tag (per the last post).

    The other page simply generates the image and sends it out to the response stream (be sure to set the Response.ContentType correctly).

    The URL in the image tag in your first page calls the second page, which spits out the image.  You're all set!

    See adec's message for how to call it, no sense in repeating what's right!  :)

    Wednesday, August 10, 2005 12:04 PM