forked from processing/processing-web-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimage.xml
More file actions
executable file
·95 lines (68 loc) · 2.59 KB
/
Copy pathimage.xml
File metadata and controls
executable file
·95 lines (68 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>image()</name>
<category>Image</category>
<subcategory>Loading & Displaying</subcategory>
<usage>Web & Application</usage>
<example>
<image>image_.jpg</image>
<code><![CDATA[
PImage b;
// Images must be in the "data" directory to load correctly
b = loadImage("laDefense.jpg");
image(b, 0, 0);
]]></code>
</example>
<example>
<image>image_2.jpg</image>
<code><![CDATA[
PImage 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);
]]></code>
</example>
<description><![CDATA[
Displays 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. Processing currently works with GIF, JPEG, and Targa images. The color of an image may be modified with the <b>tint()</b> function and if a GIF has transparency, it will maintain its transparency. The <b>img</b> parameter specifies the image to display and the <b>x</b> and <b>y</b> parameters define the location of the image from its upper-left corner. The image is displayed at its original size unless the <b>width</b> and <b>height</b> parameters specify a different size. The <b>imageMode()</b> function changes the way the parameters work. A call to <b>imageMode(CORNERS)</b> will change the width and height parameters to define the x and y values of the opposite corner of the image.
<br/> <br/>
Starting with release 0124, when using the default (JAVA2D) renderer,
smooth() will also improve image quality of resized images.
]]></description>
<syntax><![CDATA[
image(<kbd>img</kbd>, <kbd>x</kbd>, <kbd>y</kbd>)
image(<kbd>img</kbd>, <kbd>x</kbd>, <kbd>y</kbd>, <kbd>width</kbd>, <kbd>height</kbd>)
]]></syntax>
<parameter>
<label>img</label>
<description><![CDATA[PImage: the image to display]]></description>
</parameter>
<parameter>
<label>x</label>
<description><![CDATA[int or float: x-coordinate of the image]]></description>
</parameter>
<parameter>
<label>y</label>
<description><![CDATA[int or float: y-coordinate of the image]]></description>
</parameter>
<parameter>
<label>width</label>
<description><![CDATA[int or float: width to display the image]]></description>
</parameter>
<parameter>
<label>height</label>
<description><![CDATA[int or float: height to display the image]]></description>
</parameter>
<returns></returns>
<related>
loadImage()
PImage
imageMode()
tint()
background()
alpha()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>