[p5 WEB] I would like to save ‘saveFrames’ (current WEB screen) into one image variable

[p5 WEB] I would like to save ‘saveFrames’ (current WEB screen) into one image variable.

hello. Nice to meet you.

  1. I would like to save the image of the current WEB screen in a variable.

  2. I would like to edit and save the image by saving it to a variable.

  • ‘jpg file export’
    var filenames = "REPORT_"+str(year())+nf(month(),2,0)+nf(day(),2,0)+nf(hour(),2,0)+nf(minute(),2,0);    
    var pic1;
    pic1= saveFrames("0",'jpg',1,1);
    pic1=copy(pic1, 0,0,100,100, 0,0,50,50);
    pic1.save(filenames+".jpg");

How can I convert the current screen into an image variable?

see reference | p5.js

2 Likes

@Chrisir

How are you? Thank you for your quick reply.

Thanks to you, I solved it.
Thank you

     let c = get(240, 0, 1920, 1080);
     c.save(filenames+".jpg");
2 Likes

I am fine, my friend!

2 Likes