Resize image gdi+ graphics .net
问题 I have this method for shrinking down an image for a website that I'm working on: static byte[] createSmallerImage( BlogPhoto blogPhoto, int newMaxWidth, int newMaxHeight) { Image img; using (MemoryStream originalImage = new MemoryStream(blogPhoto.BlogPhotoImage)) { img = Image.FromStream(originalImage); } int newWidth; int newHeight; byte[] arr; if (img.Width > img.Height) { if (img.Width <= newMaxWidth) { using (MemoryStream thumbStr = new MemoryStream()) { img.Save(thumbStr, ImageFormat