Reference+
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
Related
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.