3 Images

3 Images - Using Pictures and Images Processing can display...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Using Pictures and Images Processing can display .gif , .jpg , .tga , and .png image First, choose Sketch | Add File to select the the image you want
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Images Now, write code like this, where hallway.jpg is the name of the picture PImage b; void setup() { size(415,350); b = loadImage("hallway.jpg"); } void draw() { image(b, 0, 0,415,350); }
Background image of page 2
Images b is the name of the variable that holds the image 0,0 is the x and y of the top left hand corner 415, 350 is the width and height PImage b ; void setup() { size(415,350); b = loadImage("hallway.jpg"); } void draw() { image( b , 0, 0 , 415, 350 ); }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Using an image for the background() Make sure the size() of the applet is the same as the size of the image. PImage bill; void setup() { size(450,315); bill = loadImage("bill-gates-mugshot.jpg"); } void draw() { background(bill); }
Background image of page 4
tint() You can change the color and opacity of an image with the tint function PImage checkers; void setup() { size(400,400); checkers = loadImage("OpArt.JPG"); } void draw() { background(0); image(checkers,50, 50,152,138); }
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 22

3 Images - Using Pictures and Images Processing can display...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online