I'm new to programming. I'm trying to write a simple drawing program using java with processing. I need help with making it take a screenshot and save the image.
Here's what I have so far.
void setup(){
size(displayWidth, displayHeight);
background(255,255,255);
}
void keyPressed(KeyEvent SPACE){
background(255,255,255);
}
void draw(){
}
void mouseDragged()
{
strokeWeight(3);
stroke(0,0,0);
line(pmouseX, pmouseY, mouseX, mouseY);
}