UInt8Array to bitmapdata - fastest way?

I have image stream as an UInt8Array …
whats the fastest way to get this data into the bitmapData? (CPP)

At the moment i’m doing this

bitmapdata.image.setPixels(new lime.math.Rectangle(0, 0, 1920, 1080), bytes, BGRA32)

Now this works good, but it takes quite a bit of resources…
Is it possible to set the data directly without using setpixels?

Yeah, if it’s formatted properly, perhaps you can set image.buffer.data?

Hm, thats what i thought too… so i tried:

bitmapdata.image.buffer.data = UInt8Array.fromBytes(bytes, 0, bytes.length);

…but i get nothing…

[Edit]
Hm… i’m adding this line and it seems to work:

bitmapdata.image.version++;

But surely this cant be the correct way to do it? :slight_smile:

Yeah, I think that’s what we rely on internally, otherwise the GL texture is out of date