We are about to switch to a new forum software. Until then we have removed the registration on this forum.
If I load an image in setup(), then in draw() it doesn't seem to matter if I invoke the image() method or not. Is there some superclass in which it is called, so my image() call is redundant? Is that, perchance, the same class where pixels is defined? I'd just like a little clarification before I talk about this in class tomorrow, so any info would be appreciated. Needless to say, I've just started looking at processing ...
Answers
I don't understand.
when you don't use image() at all, the image is not shown.
show your code, dude.
In Processing 3.0b6 the image shows up just fine, and I am not invoking image(). And just like you, Chrisir, I don't understand, hence my question :-)
with the for-loop you set the pixels of the screen to the pixels of the image
hence the image appears.
image() does the same
I appreciate your answer, but I'm still not getting this. According to the docs, loadPixels() loads the pixels array from the display window, and updatePixels() updates the array. That I follow. But how did pixels get its values in the first place?
pixels is just an internal array representing your screen
you make changes on pixels then you make changes on the screen
with updatePixels() you bring the pixels array onto the screen.
https://processing.org/reference/PImage_pixels.html
Besides pixels[] & image() approaches, set() & background() can also be used to render PImage objects:
I guess at the beginning the screen is black and thus pixels with loadPixels(); gets all 0 written in it