|
Image resizing
Hi all,
I'm trying this code but cannot figure out what is the problem to resize my image.... (i'm only showing the relative code) :
//The following is inside a panel class extending JPanel
Image image = Toolkit.getDefaultToolkit().getImage(ImageUrl);
int x, y;
public void resize(int x, int y)
{
this.x = x;
this.y = y;
bgImage.getScaledInstance(x,y,Image.SCALE_FAST);
}
//The following is inside a thread class extending Thread
while(true)
{
panel.resize(x++, y++);
panel.repaint();
}
Can you help me solve my problem?
Thanks a lot for your help.
|