解决方法
我想你最好的解决方案是使用.NET
Image类中的
GetThumbnailImage .
// Example in C#,should be quite alike in ASP.NET // Assuming filename as the uploaded file using ( Image bigImage = new Bitmap( filename ) ) { // Algorithm simplified for purpose of example. int height = bigImage.Height / 10; int width = bigImage.Width / 10; // Now create a thumbnail using ( Image smallImage = image.GetThumbnailImage( width,height,new Image.GetThumbnailImageAbort(Abort),IntPtr.Zero) ) { smallImage.Save("thumbnail.jpg",ImageFormat.Jpeg); } }