Image seen through a shape
in
Programming Questions
•
2 years ago
I want to see an image through a moving circle. I have it working in two different ways inside the black display windows.
First solution:
Any idea on how to do it?
Thanks!
First solution:
- PImage a;
void setup()
{
size(800,800);
a = loadImage("tableau1.jpg");
}
void draw()
{
background(0);
noStroke();
fill(255);
ellipse(mouseX,mouseY, 150, 150);
blend(a,0,0,800,800,0,0,800,800,DARKEST);
}
- PImage a;
void setup() {
size(800, 800);
a = loadImage("tableau1.jpg");
}
void draw(){
noStroke();
fill(0);
rect(0, 0, 800, 800);
fill(255);
ellipse(mouseX, mouseY, 150, 150);
PImage imask = get();
a.mask(imask);
image (a,0,0);
}
Any idea on how to do it?
Thanks!
1