lecture 4 Flashcards

(8 cards)

1
Q

what code would you use to load an image?

A

img = loadImage(“placeholder.png”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

would you load the image in draw or setup?

A

setup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how would you draw the image?(written in code)

A

image(img, 0, 0);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

write the code to scale the image by twice its size, and make it track your mouse position
image(img, 0, 0);

A

image(img, mouseX, mouseY, img.width * 2, img.height * 2);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what function would you use to load the image before setup?

A

preload ( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what image filters are available to you in openprocessing? name 3

A

Threshold, invert, grey, dilate, erode, posterize, blur

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how many pieces of information is a pixel described?

A

4 (RGBA)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

function setup(){
createCanvas(320,240);
pixelDensity(1);
}

what will the last line of code do?

A

This will make sure your canvas will only display one pixel per pixel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly