0
我可以問一些使用Canvas將圖像打印成圓形的提示嗎?,我的代碼無法正常工作,請幫助我。謝謝,順便說一下,我在J2ME Development Mobile App中使用了Canvas。我可以問一些使用畫布將圖像打印成圓形的提示嗎?
下面的代碼是創建一個圓而不是導入圖像的示例。
private MigoMidlet migoMidlet;
public Circle(MigoMidlet migoMidlet) {
this.migoMidlet = migoMidlet;
System.out.println("PASOK!!!!!!!!!!");
}
protected void showNotify() {
// TODO Auto-generated method stub
super.showNotify();
}
protected void paint(Graphics g) {
System.out.println("PASOK!!!!!!!!!! 11111111");
int width = getWidth();
int height = getHeight();
g.setColor(255, 255, 255);
g.fillRect(0, 0, width, height);
g.setColor(255, 0, 0);
g.drawArc(0, 0, width, height, 0, 360);
}
protected void keyPressed(int arg0) {
// TODO Auto-generated method stub
super.keyPressed(arg0);
System.out.println("repaint");
repaint();
}