Using GDI to render an image RRS feed

  • Question

  • User-390518921 posted
    Guys I have a problem. I am using GDI to render an image. Everything works without a hitch, except the image takes over the page. Meaning there nothing in that page except the image. I have an image pace holder (web control). I want to find out how I can render it in the image pace holder. All my code is in a dll and I cannot have any ASPX page as the ImageURL. I am able to serialze the stream. Any one knows of any manner that can fix or give me ideas to fix the problem. Thanks, Shrini
    Saturday, October 16, 2004 8:17 PM

All replies

  • User-1372641848 posted
    ::I want to find out how I can render it in the image pace holder. ::All my code is in a dll and I cannot have any ASPX page as the ImageURL. Only way to display image in web page is using tag, for example . http protocol does not support inserting images in the way you are trying. If you can not create aspx file then try with httphandler which can stream image. and then use url to that handler in your placeholder.
    Sunday, October 17, 2004 11:18 AM
  • User1468184652 posted
    You are going to need to have some kind of page to be the source of the image. In a web page, all images actually generate seperate requests to the web server. You can't render a page with images and layout in one request.
    Monday, October 18, 2004 10:50 AM
  • User-390518921 posted
    Is it possible to render the image in a temp folder and link to it. Shrini
    Monday, October 18, 2004 12:38 PM
  • User1468184652 posted
    aboslutely, however how are you going to know when to delete the file. Also you gotta make sure each request gets a unique file name or you may have 2 people requesting the same page at the same time.... honestly, you need to revisit your design strategy. Images should have their own page/file that they link to. Trying to do this all in one request, not only leads a larger number of potential processing bugs, but it's a nightmare to maintain when you need to alter/add functionality at a later date.
    Monday, October 18, 2004 2:34 PM
  • User-390518921 posted
    I am not worried about that becasue this file needs to be generated for the specic set of users. If the user wants to update he clicks update to regenerate the file. Other wise it picks and users the same file. How can I take the stream and create a file to a specific path. Shrini
    Monday, October 18, 2004 9:51 PM
  • User1468184652 posted
    If a "set" of users can see the images generated for another set than this task is quite simple. Make the temp folder be public within the web app. In other words a subfolder from the web app. Write all your images into this folder, and when you send the tag back to the user, just set the relative path to the image there. If a "set" of users can NOT see the images generated for another set, than you will need another page to retreive the image from a temp folder on the local web server, and stream that back to the user. This will however need to be a seperate page (no way around it) The code to do this, would be extremely similar to what you have right now to stream the image back.
    Tuesday, October 19, 2004 10:37 AM