Tendo City
Fun with request handlers :) - Printable Version

+- Tendo City (https://www.tendocity.net)
+-- Forum: Tendo City: Metropolitan District (https://www.tendocity.net/forumdisplay.php?fid=4)
+--- Forum: Ramble City (https://www.tendocity.net/forumdisplay.php?fid=44)
+--- Thread: Fun with request handlers :) (/showthread.php?tid=4757)



Fun with request handlers :) - etoven - 28th March 2008

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.



Fun with request handlers :) - lazyfatbum - 28th March 2008

*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.


Fun with request handlers :) - DMiller - 28th March 2008

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.