This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
pixel_map_issues [2007/05/24 16:36] tomliar0 |
pixel_map_issues [2007/08/30 13:53] (current) |
||
---|---|---|---|
Line 11: | Line 11: | ||
The PImage.pixels[] array (separate from the other pixels[] array, which is global) always represents the picture, even when part of it is made non-visible. This is quite useful... I wish I had figured that out earlier. | The PImage.pixels[] array (separate from the other pixels[] array, which is global) always represents the picture, even when part of it is made non-visible. This is quite useful... I wish I had figured that out earlier. | ||
+ | |||
+ | When using the PImage.pixels[] array: | ||
+ | * Don't have to use loadPixels() | ||
+ | * Use get() and set() to change color values | ||
+ | * Have to use PImage.updatePixels() | ||
+ | * Have to call image() after updating pixels. | ||
+ | |||
+ | When using the global pixels[] array: | ||
+ | * Call loadPixels() | ||
+ | * Change the array- direct access | ||
+ | * Call updatePixels() | ||
+ | * No need to call image() again- pixels[] is re-read during every call to draw() | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ |