 |
 |
 |
 |
Name |
|
loadImage() |
 |
|
|
Examples |
|
 |
PImage b;
b = loadImage("laDefense.jpg");
image(b, 0, 0);
|
 |
 |
PImage b;
void setup() {
b = loadImage("laDefense.jpg");
noLoop();
}
void draw() {
image(b, 0, 0);
}
|
 |
|
Description |
|
Loads an image into a variable of type PImage. Three types of images ( .gif, .jpg, .tga) images may be loaded. To load correctly, images must be located in the data directory of the current sketch. In most cases, load all images in setup() to preload them with the program starts. Loading images in draw() can dramatically reduce the speed of a program. To load correctly, .tga files must be 32-bit uncompressed. |
 |
|
|
Syntax |
|
loadImage(filename)
|
 |
|
|
Parameters |
|
filename |
|
string: name of file to load, must be either .gif, .jpg, or .tga
|
|
 |
|
|
Returns |
|
PImage |
 |
|
|
Usage |
|
Web & Application |
 |
|
|
Related |
|
PImage image() imageMode() background() |
|
|