 |
 |
 |
 |
Name |
|
image() |
 |
|
|
Examples |
|
 |
BImage b;
// Images must be in the "data" directory to load correctly
b = loadImage("laDefense.jpg");
image(b, 0, 0);
|
 |
 |
BImage b;
// Images must be in the "data" directory to load correctly
b = loadImage("laDefense.jpg");
image(b, 0, 0);
image(b, 0, 0, width/2, height/2);
|
 |
|
Description |
|
Diplays JPEG and GIF images to the screen. The images must be in the sketch's "data" directory to load correctly. Select "Add file..." from the "Sketch" menu to add the image. The color of an image may be modified with the tint() function. If the GIF has transparency, it will be transparent in Processing. The img parameter specifies the image to display and the x and y parameters define the location of the image. The image is displayed at its original size unless the width and height parameters specify a different size. The spatial origin of the image may be changed with the imageMode() function. |
 |
|
|
Syntax |
|
image(img, x, y)
image(img, x, y, width, height)
|
 |
|
|
Parameters |
|
img |
|
BImage: the image to display
|
x |
|
int or float: x-coordinate of the image
|
y |
|
int or float: y-coordinate of the image
|
width |
|
int or float: width to display the image
|
height |
|
int or float: height to display the image
|
|
 |
|
|
Usage |
|
Web & Application |
 |
|
|
Related |
|
loadImage() BImage imageMode() tint() background() |
|