FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. 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.  
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()
 
 






   
 
Updated: Fri Jul 15 16:35:44 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info