Top ASP.NET Items

Sponsors

Very Simple .NET Thumbnail Creation Code

When I was working the update for my Ajax demo , I needed to create thumb nail from a director of photos.  There are tons of tools out there to do this, but I thought I'd share the very simple code I used.  It takes all the jpgs in the root path and creates 160x120 thumbnails of them. It also copies the original photo into fullpath.    namespace ThumbNailer { class Program { static void Main( string [] args) { string rootPath = @"C:\Users\brada\Desktop\ForDemo" ; string thumbPath = Path .Combine(rootPath, "Thumb" ); if ( Directory .Exists(thumbPath)) DirectoryDelete(thumbPath); Directory .CreateDirectory(thumbPath); int imageNumber = 0; foreach ( string s in Directory .GetFiles(rootPath, "*.jpg" Read More...

Read the complete post at http://blogs.msdn.com/brada/archive/2008/07/10/very-simple-net-thumbnail-creation-code.aspx

Posted: Jul 10 2008, 12:15 PM by Brad Abrams
Filed under: