0

Can i ask some tips to print an image into a Circle form using Canvas?, my codes didn't work please help me .. Thanks ,, by the way i'm Using Canvas in J2ME Development Mobile App.

This codes below is a sample of creating a circle and not a import image.

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();
}
Bebeto
  • 49
  • 9

1 Answers1

0

If you are using j2me-Polish framework then no need to use canvas here.

check "circle Background" in following link,it might help.

Visual Guide to Backgrounds

vITs
  • 1,651
  • 12
  • 30