Code Snippet – C#: Generate square thumbnails
To generate a square thumbnail in c#, use this code: public Bitmap Generate75x75Pixel(Bitmap image) { if(image == null) throw new ArgumentNullException(„image“); Bitmap bmp = null; Bitmap crapped = null; int x = 0, y = 0; double prop = 0; if(image.Width > 75) { // compute proportation prop = (double)image.Width / (double)image.Height; if(image.Width > image.Height)… Code Snippet – C#: Generate square thumbnails weiterlesen