Example #1
0
 @Override
 protected void draw(Canvas canvas) {
   canvas.setColor(Color.RED);
   canvas.fillRectangle(-2, -1, 4, 2);
 }
Example #2
0
 private void draw() {
   Canvas canvas = view.getBackground();
   canvas.setColor(Color.BLUE);
   canvas.setAntiAliasing(true);
   canvas.fill();
   canvas.setColor(Color.WHITE);
   canvas.drawCircle(0, 0, 1);
   canvas.drawEllipse(0, 0, 3, 2);
   canvas.setTextSize(20);
   canvas.drawText(3, 3, "Scale=" + view.getScale());
   canvas.drawRectangle(2, 2, 4, 4);
   canvas.drawImage(2, 2, new Image("res:drawable/spain.jpg"));
   canvas.drawImage(2, 2, Image.JEDA_LOGO_64x64);
   canvas.drawLine(1, 1, 3, 1);
 }