图像类型文件 C# ASP.Net 所需的 IHttpHandler 示例
任何人都可以提供 IHttpHnalder 处理图像类型的好例子。 我想调整服务器上托管的图像的大小
Can anyone provide a good example of IHttpHnalder for handling Image Type. I want to resize the image that's hosted on my server
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 iHttpHandler 的问题
和
如何知道已请求哪个图像
两者都有用于提供图像的 HTTPHandler 示例。
Problem using iHttpHandler
and
How to know which image has been requested
Both have examples of HTTPHandlers for serving images.
Zhaph 和 Ady 的答案似乎已经指出了正确的方向,但如果您需要其他示例......
我为 Microsoft 撰写的关于
BlobStreams
的文章荷兰的 .NET 杂志包括一个从数据库 BLOB 提供图像的非常简单的示例。 不记得该示例是否使用了IHttpHandler
还是简单的 ASP.NET 页面,但对于您需要的代码来说,它确实没有那么重要。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 anIHttpHandler
or a simple ASP.NET page, but for the code you need it really doesn't matter that much.怎么样。
http://blog.jasonnussbaum.com/?p=104
源代码位于下载。
如果您要调整 GIF 的大小,您可能还需要研究图像量化 。
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.