Tendo City

Full Version: Fun with request handlers :)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What do you think Mr. Miller?
I created a dynamic request handler in .net for the new forum software.

It dynamically renders an image as a explorer type thumbnail for a file. Using the currently associated icon for a file on the web server.

I wanted to create a component that would render post attachment thumbnails for the new forum software with out having to upload a image for every file type.

For example:
ImageFileHandler.ashx?I='/UserAvitars/Ryan-Avitar.gif'&drawmode='thumnail'

Generates:

[Image: Ryan%20-%20Avitar.gif%27&drawmode=%27thumnail%27]




And For Example:

ImageFileHandler.ashx?I='/UserAvitars/Ryan-Avitar.gif'&drawmode='Icon'

Generates:

[Image: Ryan%20-%20Avitar.gif%27&drawmode=%27icon%27]




And For Example:

ImageFileHandler.ashx?I='/UserAvitars/Ryan-Avitar.gif'&drawmode='largeicon'

Renders:

[Image: Ryan%20-%20Avitar.gif%27&drawmode=%27largeicon%27]



Details:

Just put the image hander as the SRC for an image tag. The 'I' query string specifies the virtual path to the file and the 'drawmode' query string specifies render parameters.

Limitations:


  1. I could not get transparent spots to render properly so for now it renders as a jpeg.
  2. If your server has crappy icons 'like my 2000 advanced server', thats what it renders.
*high 5's etoven*

*high 5's miller*

*has no idea what's going on*

"ferret masturbation" is no where near as pleasant as it sounds.
Took me a bit to figure out why you were doing this, but now it makes sense. I've always had problems with transparency in .NET so it doesn't surprise me that you had trouble with that too. The way they handle transparency seems weird compared to every other program I use. Anyway, that's pretty cool and I even got a high five out of it without doing anything.