-
• #2
Thr 2021.07.15
re: 'is there a way to copy the contents of buffer a to buffer b while in "doublebuffered" LCDMode?'
Without a code snippet of how those buffers are created and (scope) used, unable to provide a
definitive response. Would the slice() method work?
Other ideas at:
Set each pixels color individually on Bangle.js screen -
• #3
There is no example code^^ The question boils down to this: If I use the
doublebuffered
mode, can I get a reference to the buffer that is currenty visible (a.k.a. the buffer that got drawn after callingg.flip()
in order to access it's contents (and then copy it to the other buffer to avoid redrawing identical parts). -
• #4
I understand now from your original inquiry that there doesn't appear to be a function available
from the current reference:Has an attempt been made to take a peek under the covers to see if one may garner any insight
until others may respond?Just to the right of the function declaration, there is a right facing arrow,
Bangle.setLCDMode →
which when clicked takes one to the source:
https://github.com/espruino/Espruino/blob/master/libs/banglejs/jswrap_bangle.c#L1585
(while that link reference in the docs needs to be updated)
Jump to line 1585 for the 'doublebuffered' section. Traversing the calls to certain functions may require the use of other tools such as VSCode.
-
• #5
If I use the doublebuffered mode, can I get a reference to the buffer that is currenty visible
I'm afraid not - the
doublebuffered
mode stores two buffers on the LCD itself, but the LCD is write-only, and doesn't allow copies within itself - so it's just not something that can be done.I'm not quite sure what you're planning, but for stuff like this I'd recommend trying to create an offscreen buffer with
Graphics.createArrayBuffer
. You'd have to use a lower bit depth and/or resolution to get it in memory, but once you have that you can then read data from it. In the most recent firmwares there's even ablit
function to allow you to copy between areas in the same buffer
Hello Everyone,
is there a way to copy the contents of
buffer a
tobuffer b
while in"doublebuffered"
LCDMode?-Maxi