We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello everyone, I have a unique problem that I need a conceptual solution for. Let's say that there are 2 users: A and B.
User A interacts with the sketch at size(300,300) and then pauses it after she sees a frame she likes. The sketch outputs some information (a key) that user B receives. I want user B to be able to generate that same frame on a larger canvas size with a better resolution. Both A and B would be using the same sketch code.
I have hundreds of sketches I want to do this with and all sketches use width and height to size their component elements. Any suggestions?
Answers
https://Processing.org/reference/PImage_copy_.html
https://forum.Processing.org/two/discussion/15065/can-i-store-another-images-pixel-into-a-different-image-s-pixel-buffer#latest
Thanks for the reply!
I don't think pImagecopy will change my resolution though, it just resizes the pixels, right?
https://forum.Processing.org/two/discussion/comment/61996/#Comment_61996
I think this is probably possible. But the key will have to encode all the interaction that user a has done (you don't say what this interaction is, if it's freehand drawing then you're probably stick, if it's clicking on half a dozen multiple choice options then it's a doddle), AND the sketch will have to be coded so that everything is drawn in terms of width or height (and have the same aspect ratio)
Hi koogs, Thanks for the reply! I used agree with you (that encoding vars was the only way), but I now think GoToloop's most recent answer might point to an easier and more general solution.
If I draw to a buffer (pgraphics) I can resize it with copy so user B can interact with a scaled down version, but I can save a frame with high resolution.
The only problem is that I want the canvas that user B sees and interacts with to be the size of the scaled down version i.e. I need to save a buffer frame which is larger than the canvas. Any ideas how to do that? Or is there another work around I'm not seeing?
get0 will only get pixels inside the canvas unfortunately.
I ended up exporting to an svg if anyone was curious.