q5play
    Preparing search index...

    Function updatePixels

    • 🌆 Applies changes in the pixels array to the canvas or image.

      Not applicable to WebGPU canvases.

      Returns void

      await Canvas(200);
      let c = color('pink');

      let img = createImage(50, 50);
      for (let x = 0; x < 50; x += 3) {
      for (let y = 0; y < 50; y += 3) {
      img.set(x, y, c);
      }
      }
      img.updatePixels();

      background(img);