VOOZH about

URL: https://processing.org/reference/loadpixels_

⇱ loadPixels() / Reference / Processing.org


Reference+
DocumentationReferenceImagePixels

Name

loadPixels()

Description

Loads the pixel data of the current display window into the pixels[] array. This function must always be called before reading from or writing to pixels[]. Subsequent changes to the display window will not be reflected in pixels until loadPixels() is called again.

Examples

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

Syntax

  • loadPixels()

Return

  • void