PImage::set() \ Language (API) \ Processing 1.0
Search processing.org:
Language (A-Z) \
Libraries \
Tools \
Environment \
Compare \
Troubleshooting
Reference for Processing version 1.0+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Class
PImage
Name
set()
Examples
PImage img = loadImage("tower.jpg");
color black = color(0, 0, 0);
img.set(30, 20, black);
img.set(85, 20, black);
img.set(85, 75, black);
img.set(30, 75, black);
image(img, 0, 0);
Description
Changes the color of any pixel or writes an image directly into the image. The x and y parameter specify the pixel or the upper-left corner of the image. The color parameter specifies the color value.Setting the color of a single pixel with set(x, y) is easy, but not as fast as putting the data directly into pixels[]. The equivalent statement to "set(x, y, #000000)" using pixels[] is "pixels[y*width+x] = #000000". Processing requires calling loadPixels() to load the display window data into the pixels[] array before getting the values and calling updatePixels() to update the window.
As of release 0149, this function ignores imageMode().
Syntax
img.set(x, y, color)
Parameters
img
PImage: any variable of type PImage
x
int: x-coordinate of the pixel or upper-left corner of the image
y
int: y-coordinate of the pixel or upper-left corner of the image
color
color: any value of the color datatype
Returns
None
Usage
Web & Application
Related
get()pixels[]copy()
Updated on November 22, 2008 08:39:25pm PST
Processing was initiated by Ben Fry and Casey Reas. It is developed by a small team of volunteers.
© Info \
Site hosted by Media Temple!
Wyszukiwarka
Podobne podstrony:
PImage setfunction mcal event set endfunction pdf set horiz scalingfunction ldap set optionPatons Grace Daisies and Stripes Set with Blanketfunction pdf set info subjectThe Complete Pentium Instruction Set Table (32 Bit Addressing Mode Only)function cpdf set viewer preferencesset wallpaperset home locationfunction ftp set optionfunction com setPImage loadPixelsfunction cpdf global set document limitsfunction stream set write bufferfunction mcal event set alarmset quest var partwięcej podobnych podstron