const intbitmap_width = 240;
const intbitmap_height = 80;
Commentsutput bpp: 16,Output format: RGB565
Code:
const unsigned shortbitmap_data[19200] = {
0xFFFF,
0xFFFF,
0xFFFF,
....
....etc..
}
But now output is
const charImage[] = {
800, 600, comment:Imagesize width x height (in pixel)
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
..etc..
}
This tool is used in freescale's IMX31 bsp's display driver .I need that same tool...Or Shall i change my output file to that format?
Regards
Serene
unsigned char MyBMPData[ ] ={, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff etc.......}; #include<stdio.h>#include<stdlib.h>typedef unsigned short WORD;#define RGB_TO_565(r, g, b) (WORD) ((r & 0xf8 )<<8) | ((g&0xfc)<<3) | ((b&0xf8)>>3)void main(){ FILE *fp; int length = sizeof(MyBMPData)/sizeof(unsigned char ); printf("\n%d\n", length); int logoLength= length/3; printf("\nx =%d\n", logoLength); unsigned short *logo; logo = (unsigned short*)malloc(logoLength*sizeof(unsigned short)); char logoBuffer[25]; fp = fopen("C://MyLogo.c","w"); // opens a file to store RGB 565 format data outpurt sprintf(logoBuffer,"MyLogo[%d] =\n { \n",logoLength); printf("%s",logoBuffer); fprintf(fp,"%s",logoBuffer); for(int index = 0,logoIndex =0; (index<length && logoIndex<logoLength);logoIndex++) { logo[logoIndex] = RGB_TO_565(MyBMPData[index],MyBMPData[index+1],MyBMPData[index+2]); index = index+3; printf("0x%x, ", logo[logoIndex]); fprintf(fp,"0x%x, ", logo[logoIndex]); if((logoIndex+1)%20 ==0) { printf("\n"); fprintf(fp,"\n"); } } printf("};"); fprintf(fp,"};"); fclose(fp);} /*********the output file would look like this****************/ MyLogo[19200] = {0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, \ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, \ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, \ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, \ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, \ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, \ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff etc...};