I want to preserve the content of Graphics buffer and reuse it later. But when I store in a new Uint8Array it and call graphics.clear(), it clears the saved variable also. See below example.
I am saving g.buffer in fb variable and after calling g.clear(), it clears fb also.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I want to preserve the content of Graphics buffer and reuse it later. But when I store in a new Uint8Array it and call graphics.clear(), it clears the saved variable also. See below example.
I am saving g.buffer in fb variable and after calling g.clear(), it clears fb also.
How to resolve this?