xxxxxxxxxx
20
var ocanvas, octx, img1;
function setup() {
createCanvas(400, 400);
ocanvas = document.createElement("canvas");
ocanvas.width = width;
ocanvas.height = height;
//get the drawing context of the render canvas
octx = ocanvas.getContext("2d");
octx.beginPath();
octx.arc(width / 2, height / 2, 64, Math.PI * 2, false);
octx.closePath();
octx.fillStyle = 'rgba(255, 0, 255, 1)';
octx.fill();
img1 = loadImage(ocanvas.toDataURL());
}
function draw() {
background(220);
image(img1, 0, 0);
}