Files
JGame2D/src/de/miaurizius/jgame2d/core/Utility.java

15 lines
427 B
Java

package de.miaurizius.jgame2d.core;
import java.awt.image.BufferedImage;
public class Utility {
public static BufferedImage scaleImage(BufferedImage img, int width, int height) {
BufferedImage scl = new BufferedImage(width, height, img.getType());
scl = new BufferedImage(width, height, img.getType());
scl.createGraphics().drawImage(img, 0, 0, width, height, null);
return scl;
}
}