Hi, I've been trying to scale an image with the following code:
The problem is that it doesn't work properly with images that contain an alpha canal (some parts are deleted and the others don't get scaled) which gives a very bad quality of animation. Any idea how to fix it please?
public void act()
{
counter++;
if(counter%2 == 0 && counter<240)
{
try
{
double newWidth = image.getWidth()*0.99;
double newHeight = image.getHeight()*0.99;
image.scale((int)(newWidth), (int)(newHeight));
setImage(image);
}catch(IllegalArgumentException e){getWorld().removeObject(this);}
}
else
{
getImage().setTransparency(getImage().getTransparency()-4);
if(getImage().getTransparency()<20)
{
getWorld().removeObject(this);
}
}
}

