Added ability to change width and height for the visual image
Change indentation to 2 spaces instead of 4 Added ImageHandler.java for basic Image related things Added 2 new speedometer images for scaling purposes Updated to version 3 Gave gradle more ram Added the new translatable texts to en_us.json
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package me.zacharias.speedometer;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class ImageHandler {
|
||||
public static BufferedImage scale(BufferedImage img, int width, int height) {
|
||||
Image img1 = img.getScaledInstance(width,height, Image.SCALE_DEFAULT);
|
||||
BufferedImage out = new BufferedImage(width, height,BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g2d = out.createGraphics();
|
||||
g2d.drawImage(img1,0,0,null);
|
||||
return out;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user