Processing: onClick screenshot


/ Published in: Processing
Save to your folder(s)



Copy this code and paste it in your HTML
  1. void mouseReleased() {
  2. saveFrame(gimme_name("myProject_"));
  3. };
  4.  
  5. String gimme_name(String begin)
  6. {
  7. String name = begin;
  8. name+=String.valueOf(year());
  9. name+=".";
  10. if(month()<10) name+="0";
  11. name+=String.valueOf(month());
  12. name+=".";
  13. if(day()<10) name+="0";
  14. name+=String.valueOf(day());
  15. name+="_";
  16. if(hour()<10) name+="0";
  17. name+=String.valueOf(hour());
  18. name+=".";
  19. if(minute()<10) name+="0";
  20. name+=String.valueOf(minute());
  21. name+=".";
  22. if(second()<10) name+="0";
  23. name+=String.valueOf(second());
  24. name+=".png";
  25. return name;
  26. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.