Hello, Is anyone there to help me? I am looking to Reduce the Size of my Image in Actor method...Could someone help me with this problem!!
//global
GreenfootImage img=new GreenfootImage("xyz.png");
//Method
img.getImage().scale(50,50);//Method img.getImage().scale(50,50);
img.scale(50, 50);
double scale= 0.5; // for example img.scale((int)(img.getWidth() * scale), (int)(img.getHeight() * scale));
public static void scaleToWidth(GreenfootImage img, int width) {
img.scale(width, (int)(img.getHeight() * width / (double)img.getWidth()));
}
public static void scaleToHeight(GreenfootImage img, int height) {
img.scale((int)(img.getWidth() * height / (double)img.getHeight()), height);
}