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 .
thanksCode:/* import java.io.IOException; import javax.microedition.lcdui.*; import javax.microedition.lcdui.game.GameCanvas; /** * @author mahdi */ 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(); } } }


Reply With Quote


