?? navigatecanvas.java
字號(hào):
import javax.microedition.lcdui.*;
class NavigateCanvas extends Canvas {
int width = 0;
int height = 0;
private Image image;
private int newX=0;
private int newY=0;
public NavigateCanvas(Image image) {
this.image=image;
newX=0;
newY=0;
}
public void steppingXY(int x, int y) {
newX += x;
newY += y;
}
public void paint(Graphics g) {
width=this.getWidth();
height=this.getHeight();
g.setGrayScale(255);
g.fillRect(0,0,width-1,height-1);
g.setGrayScale(0);
g.drawRect(0,0,width-1,height-1);
g.translate(newX, newY);
g.drawImage(image,0,0, g.TOP|g.LEFT);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -