mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
New images for 2.0 Image Examples
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user