[RESOLVED]Can System.Web.Helpers.WebImage be used to dynamicly resize images for display on webpages?

I have been looking at a way to store a single large file on the server but dynamically resize it depending on what the user wants (think wallpapers for download) when I ran across the System.Web.Helpers.WebImage class. I have been doing some searching but
everything I find looks to be for resizing and then saving the new image to the server. I was wondering if/how this class could be used in an ASP.Net MVC Web App to dynamically resize an image and serve it up to the web page with out saving the resized image
to the server.

You can do this with the gdi components


the above is for webforms, but the code will be the same except you return a File result from your controller


If you google for creating thumbnails on the fly you’ll probably find an mvc-specific example.


According to the doc, it seems like .Write() just sent the image content to the browser output. At worst you could use GetBytes() to get the bytes and write them yourself.

Searching based on that gave me things like:

http://www.leniel.net/2012/04/resize-img-on-fly-aspnet-webimage.html#sthash.aoiVMWxR.dpbs or


Here is a MVC version of thumbnail

ASP.NET MVC ImageHandler for Thumbnails

Leave a Reply