New images for 2.0 Image Examples

This commit is contained in:
Casey Reas
2011-09-15 03:59:03 +00:00
parent b1584bf1f6
commit 346741702f
9 changed files with 88 additions and 125 deletions
@@ -9,16 +9,17 @@ PImage img;
void setup()
{
size(200, 200);
img = createImage(120, 120, ARGB);
for(int i=0; i < img.pixels.length; i++) {
img.pixels[i] = color(0, 90, 102, i%img.width * 2);
size(640, 360);
img = createImage(230, 230, ARGB);
for(int i = 0; i < img.pixels.length; i++) {
float a = map(i, 0, img.pixels.length, 255, 0);
img.pixels[i] = color(0, 90, 102, a);
}
}
void draw()
{
background(204);
image(img, 33, 33);
image(img, mouseX-60, mouseY-60);
background(0);
image(img, 90, 80);
image(img, mouseX-img.width/2, mouseY-img.height/2);
}