Hi please look this code , when i run it on nokia N97 its run very slow but i test it on samsung corby its run true , i think if i use game canvas problem be sloved . what should i do to solve this problem .
public class MIDPCanvas extends GameCanvas implements Runnable {
Graphics g;
Image img;
int x = getWidth() / 2;
Thread t = new Thread(this);
public MIDPCanvas() {
super(true);
try {
img = Image.createImage("/pic.jpg");
} catch (IOException ex) {
ex.printStackTrace();
}
g = getGraphics();
g.setColor(150, 230, 200);
g.fillRect(0, 0, getWidth(), getHeight());
t.start();
}
public void run() {
while (true) {
g.drawImage(img, x, getHeight() / 2, Graphics.VCENTER | Graphics.HCENTER);
x--;
flushGraphics();
}
}
}
thanks