You are reading a single comment by @JumJum and its replies. Click here to read the full conversation.
  • I would like to load a binary image from sd directly to a graphicsbuffer.
    The only way, it worked for me is this:

    var gr = Graphics.createArrayBuffer(64,32,4,{inte­rleavex:true});  //this is a 64x32 LED matrix
    fs = require("fs");
    var x = E.toUint8Array(fs.readFile("myFile.bin")­); //myFile.bin is binary file holding 1024 bytes
    for(var i = 0; i < 1024; i++) gr.buffer[i] = x[i];
    

    Using a temporary array and copy value by value in a loop looks strange to me.
    And it takes a lot of CPU power to copy.
    But all I tried to assign Uint8Array directly to graphics buffer, failed.
    Failed in the way, that loaded image was not shown.

    I'm pretty sure, there is a way to do better, but I don't find it.

About

Avatar for JumJum @JumJum started