Hi
please look this code , when i run it on nokia N97 it`s run very slow but i test it on samsung corby it`s run true , i think if i use game canvas problem be sloved . what should i do to solve this problem .
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.IOException;
import javax.microedition.lcdui.*;
/**
* @author mahdi
*/
public class MIDPCanvas extends Canvas implements Runnable {
Graphics g;
Image img;
int x = getWidth() / 2;
Display display;
public MIDPCanvas(Display display) {
this.display = display;
try {
img = Image.createImage("/pic.jpg");
} catch (IOException ex) {
ex.printStackTrace();
}
}
protected void paint(Graphics g) {
g.drawImage(img, x, getHeight() / 2, Graphics.VCENTER | Graphics.HCENTER);
display.callSerially(this);
}
public void run() {
try {
Thread.sleep(10);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
x--;
repaint();
}
}
its run on wtk very fast but in other emulator like LG or nokia its slow
thanks