Posted: 7th Sep 2023 21:03
Hello...

Does anyone know how to write a byte array into a memblock???

I would be using this technique to load my images from database records that would be storing them as binary objects.

Thank you...

Steve Naidamast
Sr. Software Engineer
Posted: 8th Sep 2023 13:47
You'd need to create a memblock; then in it's simplest form you'd run through and set the bytes in the mem block...

eg;
for lp =0 to Number_Of_Bytes
SetMemblockByte( memID, lp , MyArray[ lp ] )
next
Posted: 8th Sep 2023 15:44
Thank you, Kevin...

Looking at the documentation that is the conclusion I came to.

However, that is quite inefficient for any sized Byte array. As a result, I was looking to avoid doing that.

I am surprised that the engine does not allow for memory-streams so that images can be stored in a database.

Steve Naidamast
Sr. Software Engineer
Posted: 8th Sep 2023 23:37
You can set up a dynamic write for memory blocks, but it is not a very efficient thing as far as I know...

https://forum.thegamecreators.com/thread/228470