Decode bmp and display it on littlevgl

Hi, i can succesfully display images to LCD using my LCD-converter to 24 bits and port it over to my code. But currently my task is to retrieve images from server and display onto LCD. Im not using SD card to store my data. Now i need help to filter off the incoming header/ decode the images. I will attach my code below. Please check it for me

#include <XG8800.h>

XGLCD tft = XGLCD();

static const uint32_t image_data_alerts[18216] = {
(eg 0x000000 this string outputis taken from serial monitor ) };

void drawArray(const uint32_t * image,uint32_t isize,uint16_t iwidth,uint16_t x,uint16_t y){
uint16_t pixels[iwidth];//container
uint32_t i,idx;
for (idx=0;idx<isize/iwidth;idx++){
for (i = (iwidthidx); i < iwidth(idx+1);i++){
pixels[i - (iwidth*idx)] = tft.Color24To565(image*);*

  • }*
  • tft.drawPixels(pixels,iwidth,x,idx+y);*
  • }*
    }
    void setup()
    {
  • tft.begin();*
  • drawArray(image_data_alerts,18216,184,tft.width()/2-184/2,tft.height()/2-99/2);*
    }
    void loop()
    {
    }

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

What model Arduino are you using?

Thanks.. Tom.. :slight_smile:

Because if you do do not post it properly in a "code" window, it often appears mangled.

As your has. :cold_sweat:

try putting the code with this to print at the bottom, also change the output to 0x00 instead

for(int i=1;i<sizeof(image_hex_array);i++){
if (image_hex_array == 0x4d && image_hex_array[i-1] == 0x42) {

  • bmpdata_position = i + 53;*
  • break;*
  • }*
  • }*