Name

updatePixels()

Description

Updates the display window with the data in the pixels[] array. Use in conjunction with loadPixels(). If you're only reading pixels from the array, there's no need to call updatePixels() — updating is only necessary to apply changes.

Examples

  • size(400,400);
    PImage img = loadImage("mt-fuji.jpg");
    image(img, 0, 0);
    int halfImage = img.width * img.height/2;
    loadPixels();
    for (int i = 0; i < halfImage; i++) {
      pixels[i+halfImage] = pixels[i];
    }
    updatePixels();
    Image output for example 1

Syntax

  • updatePixels()

Return

  • void