mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 19:31:16 +01:00
26 lines
438 B
Plaintext
26 lines
438 B
Plaintext
/**
|
|
* Save One Image
|
|
*
|
|
* The save() function allows you to save an image from the
|
|
* display window. In this example, save() is run when a mouse
|
|
* button is pressed. The image "line.tif" is saved to the
|
|
* same folder as the sketch's program file.
|
|
*/
|
|
|
|
void setup()
|
|
{
|
|
size(200, 200);
|
|
}
|
|
|
|
void draw()
|
|
{
|
|
background(204);
|
|
line(0, 0, mouseX, height);
|
|
line(width, 0, 0, mouseY);
|
|
}
|
|
|
|
void mousePressed()
|
|
{
|
|
save("line.tif");
|
|
}
|