Summary
Calling GetByteArray() on a real roScreen object (not an roBitmap) returns Invalid on real Roku hardware, instead of an roByteArray. The identical call, on the identical code path, returns real pixel data on both the BrightScript Simulator (desktop app) and headless brs-node/brs-cli.
Reproduction
screen = CreateObject("roScreen", true, 1280, 720)
screen.SetAlphaEnable(true)
' ... draw something opaque, e.g. screen.DrawRect(300, 150, 320, 320, &h00FF00FF) ...
pixel = screen.GetByteArray(460, 310, 1, 1) ' a point known to be inside the drawn rect
' pixel is a real roByteArray with RGBA bytes on the Simulator/brs-node.
' pixel is Invalid on real hardware - indexing it (pixel[1]) crashes with
' "Array operation attempted on variable not DIM'd."
Isolated by
roBitmap.GetByteArray() is unaffected on either platform - confirmed via this repo's own Rooibos test suite, which uses it routinely on roBitmap instances.
- The difference is specific to calling
GetByteArray() on a live roScreen.
Environment
- Real hardware: standard Roku device (Roku OS 15.3.4).
- Simulator comparison: BrightScript Simulator desktop app (
brs-desktop) and headless brs-node/brs-cli, same Roku OS version reported, same channel package.
Found while building a diagnostic test in an open-source game engine (https://github.com/markwpearce/brighterscript-game-engine) - happy to share the exact test source or more detail if useful.
Summary
Calling
GetByteArray()on a realroScreenobject (not anroBitmap) returnsInvalidon real Roku hardware, instead of anroByteArray. The identical call, on the identical code path, returns real pixel data on both the BrightScript Simulator (desktop app) and headlessbrs-node/brs-cli.Reproduction
Isolated by
roBitmap.GetByteArray()is unaffected on either platform - confirmed via this repo's own Rooibos test suite, which uses it routinely onroBitmapinstances.GetByteArray()on a liveroScreen.Environment
brs-desktop) and headlessbrs-node/brs-cli, same Roku OS version reported, same channel package.Found while building a diagnostic test in an open-source game engine (https://github.com/markwpearce/brighterscript-game-engine) - happy to share the exact test source or more detail if useful.