Wie ändert man die Größe eines Bildes? Im Grunde ganz einfach …
1 2 3 4 5 6 7 8 9 10 |
public Image ResizeImage(Image image, int width, int height) { Image destinationImage = new Bitmap(width, height); Graphics graphic = System.Drawing.Graphics.FromImage(destinationImage); // Draw on the graphics and resize the image graphic.DrawImage(image, 0, 0, width, height); return destinationImage; } |
oder einfacher…
1 2 3 4 |
public static Image ResizeImage(Image image, int width, int height) { return new Bitmap(image, width, height); } |