On the fly images

mark007

Centurion
Joined
Jan 22, 2005
Messages
185
Location
York, UK
I need to generate some images on the fly in my ASP.net pages. Currently the only way I think I can do this is to have a page dedicated to generating image with the content type image/jpeg and then saving the image to the outputstream of the response. The in my main page pass this page as the src of an Img tag. I have 2 queries:

1. Is this the only/best way of displaying a dynamic image on a page?

2. What's the best way of getting data from the page to the image? If it was a small amount of data I could just put it in the querystring of the src url of the img tag but it's likely to be an array of variable length. I was therfore thinking of using the cache to save the data to perhaps under an id. The image generating page could then have the ID passed in the querystring and retrieve the data from the cache and finally remove it to free it up. Is this the best way of doing it? Can anybody think of any flaws?

Thanks.

:)
 
Back
Top