forked from processing-js/processing-js.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPImage_resize_.html
More file actions
73 lines (68 loc) · 1.9 KB
/
Copy pathPImage_resize_.html
File metadata and controls
73 lines (68 loc) · 1.9 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
---
layout: default
---
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr>
<th scope="row">Class</th>
<td>PImage</td>
</tr>
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>resize()</h3></td>
</tr>
<tr class="">
<th scope="row">Examples</th>
<td><div class="example"><img src="/reference/PImage_resize.jpg" alt="example pic" /><pre class="margin">// @pjs preload must be used to preload the image
/* @pjs preload="jelly.jpg"; */
PImage img = loadImage("jelly.jpg");
image(img, 0, 0);
img.resize(100, 50);
image(img, 0, 0)</pre></div>
<div class="example"><img src="/reference/PImage_resize_2.jpg" alt="example pic" /><pre class="margin">// @pjs preload must be used to preload the image
/* @pjs preload="jelly.jpg"; */
PImage img = loadImage("jelly.jpg");
image(img, 0, 0);
img.resize(0, 50);
image(img, 0, 0);</pre></div>
</td>
</tr>
<tr class="">
<th scope="row">Description</th>
<td><p>Resize the image to a new width and height. To make the image scale proportionally, use 0 as the value for the <b>wide</b> or <b>high</b> parameter.</p></td>
</tr>
<tr class="">
<th scope="row">Syntax</th>
<td><pre><kbd>img</kbd>.resize(<kbd>wide</kbd>,<kbd>high</kbd>)</pre></td>
</tr>
<tr class="">
<th scope="row">Parameters</th>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row">img</th>
<td>PImage: any variable of type PImage</td>
</tr>
<tr class="">
<th scope="row">wide</th>
<td>int: the resized image width</td>
</tr>
<tr class="">
<th scope="row">high</th>
<td>int: the resized image height</td>
</tr>
</table>
</td>
</tr>
<tr class="">
<th scope="row">Returns</th>
<td>void</td>
</tr>
<tr class="">
<th scope="row">Usage</th>
<td>Web & Application</td>
</tr>
<tr class="">
<th scope="row">Related</th>
<td><a href="../reference/get_">get()</a><br /></td>
</tr>
</table>