Thread: Image resizing
View Single Post
  #1 (permalink)  
Old 11-13-2007, 12:47 AM
alley alley is offline
Member
 
Join Date: Nov 2007
Posts: 6
alley is on a distinguished road
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.
Reply With Quote
Sponsored Links