Skip to content

Commit c6b37c7

Browse files
author
Lauren McCarthy
committed
adding example for image.resize
1 parent 5ecc0a9 commit c6b37c7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/objects/p5.Image.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,22 @@ define(function (require) {
206206
* @method resize
207207
* @param {Number} width the resized image width
208208
* @param {Number} height the resized image height
209+
* @example
210+
* <div><code>
211+
* var img;
212+
*
213+
* function setup() {
214+
* img = loadImage("assets/rockies.jpg");
215+
* }
216+
217+
* function draw() {
218+
* image(img, 0, 0);
219+
* }
220+
*
221+
* function mousePressed() {
222+
* img.resize(100, 200);
223+
* }
224+
* </code></div>
209225
*/
210226
p5.Image.prototype.resize = function(width, height){
211227

0 commit comments

Comments
 (0)