// subcanvas
x = 80;
canvas.drawRectangle(x, y, width, height, gray);
Canvas subcanvas = canvas.createSubcanvas(x + 1, y + 1, width - 1, height - 1);
subcanvas.drawRectangle(0, 0, width - 2, height - 2, blue);
x = 150;
canvas.drawRectangle(x, y, width, height, gray);
subcanvas = canvas.createSubcanvas(x + 1, y + 1, width - 1, height - 1);
subcanvas.offset(-100, -200);
subcanvas.drawRectangle(100, 200, width - 2, height - 2, red);
subcanvas.drawRectangle(0, 0, 120, 220, green);
// solid shapes
x = 10;
y = 105;
canvas.drawRectangle(x - 1, y - 1, width + 2, height + 2, gray);
canvas.drawSolidRectangle(x, y, width, height, black);
canvas.drawSolidOval(x, y, width, height, green);
canvas.drawLine(x, y, x + width - 1, y + height - 1, red);
canvas.drawLine(x, y + height - 1, x + width - 1, y, red);
x = 80;
canvas.drawSolidRectangle(x, y, width, height, black);
subcanvas = canvas.createSubcanvas(x + 1, y + 1, width - 1, height - 1);
subcanvas.drawSolidRectangle(0, 0, width - 2, height - 2, blue);
x = 150;
canvas.drawRectangle(x, y, width, width, black);
canvas.drawOval(x, y, width, width, green);