Save some images...
in
Programming Questions
•
1 year ago
Hi there! I have a question about how to save some images.
What I'm trying is that every time the user presses Ctrl + S to save the image processing save with name image-0001.png and then when the user presses again Ctrl + S image-0002.png. How do I can do this?
I'm using the code below and what happens with this is that the image is saved with the number of the frame:
What I'm trying is that every time the user presses Ctrl + S to save the image processing save with name image-0001.png and then when the user presses again Ctrl + S image-0002.png. How do I can do this?
I'm using the code below and what happens with this is that the image is saved with the number of the frame:
boolean[] keys = new boolean[526];
boolean checkKey(int k)
{
if (keys.length >= k) {
return keys[k];
}
return false;
}
void keyPressed() {
keys[keyCode] = true;
println(KeyEvent.getKeyText(keyCode));
if (checkKey(CONTROL) && checkKey(KeyEvent.VK_S)) {
println("CTRL+S");
saveFrame("Block_Mania-####.png");
}
}
1