0 Replies Latest reply on Jun 26, 2011 9:04 AM by Zloubi

    Convert 3bytes / pixel ByteArray to BitmapData

    Zloubi Level 1



      In a flash application, I've got a bytearray containing the RGB values as 3 bytes per pixel, I have this piece of code to translate it into a bitmapdata :


      for(j = 0; j < bmpData.height; j++){
           for(i = 0; i < bmpData.width; i++){

                bmpData.setPixel(i,j, buffer.readUnsignedByte() | buffer.readUnsignedByte()<<8 | buffer.readUnsignedByte()<<16);


      This is working properly but is too slow. I would like to use pixelbender to speed things up, is it possible ? For now it doesn't looks like