How to save part of the screen and restore it later? #7327
Replies: 1 comment
-
Posted at 2025-01-30 by @gfwilliams
I'd have suggested you make a Graphics instance and then draw the Graphics onto it, but I just checked and it seems you can't do that at the moment (it only works for ArrayBuffer Graphics instances). It does make sense to be able to supply options to If you don't want to rely on the latest builds, the other option is to actually do the drawing of the area you want to update a lot in an offscreen buffer created with Posted at 2025-01-30 by mbork Wow, thanks for the quick answer! And thanks for pointing me to Altogether, it means that it's possible that I'll make a nice clockface soon (for some value of "soon", I'll probably not be able to start working on it earlier than in ~2 weeks). Posted at 2025-01-30 by @gfwilliams
Realistically I'll probably have made a 2v26 release by then so you might find you can use asImage anyway! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2025-01-30 by mbork
I'd like to be able to save a (small) part of the screen (that is, a bitmap) to a variable and restore it later, so that I can:
How to do that?
Graphics.asImage() seems to store the whole screen. Using
Graphics.getPixel()
in a nested loop seems inefficient. Is there another way?Beta Was this translation helpful? Give feedback.
All reactions