Name | image() |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Examples | // @pjs preload must be used to preload the image /* @pjs preload="laDefense.jpg"; */ PImage b; b = loadImage("laDefense.jpg"); image(b, 0, 0); // @pjs preload must be used to preload the image /* @pjs preload="laDefense.jpg"; */ PImage b; b = loadImage("laDefense.jpg"); image(b, 0, 0); image(b, 0, 0, width/2, height/2); |
||||||||||
Description | Diplays images to the screen. The images must be preloaded using @pjs preload before it can be used. Processing currently works with GIF, JPEG, and Targa images. The color of an image may be modified with the tint() function and if a GIF has transparency, it will maintain its transparency.
The img parameter specifies the image to display and the x and y parameters define the location of the image from its upper-left corner.
The image is displayed at its original size unless the width and height parameters specify a different size.
The imageMode() function changes the way the parameters work.
A call to imageMode(CORNERS) will change the width and height parameters to define the x and y values of the opposite corner of the image.
NOTE: DOM security will not allow you to load images file:/// URIs. This security can be overridden in Firefox in about:config, by changing security.fileuri.strict_origin_policy to false. |
||||||||||
Syntax | image(img, x, y) image(img, x, y, width, height) |
||||||||||
Parameters |
|
||||||||||
Usage | Web & Application | ||||||||||
Related |
loadImage() PImage imageMode() tint() background() alpha() |