 |
 |
 |
 |
Name |
|
updatePixels() |
 |
|
|
Examples |
|
 |
int halfImage = width*height/2;
PImage myImage = loadImage("topanga.jpg");
image(myImage, 0, 0);
loadPixels();
for(int i=0; i<halfImage; i++) {
pixels[i+halfImage] = pixels[i];
}
updatePixels();
|
 |
 |
int halfImage = width*height/2;
PImage myImage = loadImage("towerFlip.jpg");
image(myImage, 0, 0);
loadPixels();
for(int i=0; i<halfImage; i++) {
pixels[i+halfImage] = pixels[i];
}
updatePixels(50, 0, 50, 100);
|
 |
|
Description |
|
Updates the display window with the current data from pixels[]. It's possible to only update a portion of the window by specifying a smaller rectangle with the x1, y1, width, height parameters. The imageMode() function changes the way the parameters work. For example, imageMode(CENTER) will change x and y to define the center of the image. A call to imageMode(CORNERS) will change the width and height parameters to define the x and y coordinates of the opposite corner of the image. |
 |
|
|
Syntax |
|
updatePixels()
updatePixels(x1, y1, width, height)
|
 |
|
|
Parameters |
|
x1 |
|
int: x-coordinate for the upper-left corner
|
y1 |
|
int: y-coordinate for the upper-right corner
|
x2 |
|
int: width or x-coordinate for the opposite corner depending on the current imageMode()
|
y2 |
|
int: height or y-cooordinate for the opposite corner depending on the current imageMode()
|
|
 |
|
|
Usage |
|
Web & Application |
 |
|
|
Related |
|
pixels[] loadPixels() |
|
|