问题
Can anyone provide a good example of IHttpHnalder for handling Image Type. I want to resize the image that's hosted on my server
回答1:
Problem using iHttpHandler
and
How to know which image has been requested
Both have examples of HTTPHandlers for serving images.
回答2:
The answers by Zhaph and Ady seem to point in the right direction already, but if you need an additional example...
My article on BlobStreams for the Microsoft.NET Magazine here in Holland includes a very simple example of serving images from database BLOBs. Can't remember if the example used an IHttpHandler
or a simple ASP.NET page, but for the code you need it really doesn't matter that much.
回答3:
How About. http://blog.jasonnussbaum.com/?p=104
Source is available in the downlaod.
If you are resizing GIF you may also want to look into image quantizing.
来源:https://stackoverflow.com/questions/386142/ihttphandler-example-required-for-image-type-files-c-sharp-asp-net