cancel
Showing results for 
Search instead for 
Did you mean: 

More Info about converting a BMP for the 746 LCD, please

LMI2
Lead
Posted on June 01, 2017 at 16:26

Exacly how is BSP_LCD_DrawBitmap using data?

I read the text above the function definition and did just as it said. I tried various=every options, but nothing worked. I used a software called Image2Lcd(.exe).

Then someone mentioned a program called bin2header.exe here in this forum. After a bit fine tuning the data, it created a working datafile. But there is no info about how it did it.

Surely, every program is able to do the conversion. But how.

6 REPLIES 6
LMI2
Lead
Posted on June 01, 2017 at 21:42

It looks like the program Image2Lcd(.exe), I was using, did not work here. Even the start of a bitmap file was wrong, no matter what I tried..

john doe
Lead
Posted on June 02, 2017 at 01:32

I successfully use gimp to create bitmaps in the argb8888 format.  im not making them into a header file, but argb8888 is a format that BSP_LCD_DrawBitmap can grok

Posted on June 02, 2017 at 16:31

This is interesting. I tried Gimp but the file it produced did not look like correct. There were macros and such. I exported image as header .h.

What settings did you use?

Posted on June 03, 2017 at 01:18

I didnt make a header file. I either read the bitmap off a uSD card, usb thumb drive, or qspi flash on the board. the st utilities you found do it right. I really wish they were open source so I could build them on a mac.

LMI2
Lead
Posted on June 03, 2017 at 14:03

Yes, reading images from SD card is a good option.

Have you opened the stlogo.h file from for example ...STM32Cube\Repository\STM32Cube_FW_F7_V1.7.0\Projects\STM32746G-Discovery\Examples\BSP\Inc folder? You can do it with basic text editor. It begins like this. (-comments)

#ifndef __STLOGO_H
#define __STLOGO_H
__ALIGN_BEGIN const unsigned char stlogo[9174] __ALIGN_END =
{
0x42,0x4d,0xd6,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
0x00,0x00,0x50,0x00,0x00,0x00,0x39,0x00,0x00,0x00,0x01,0x00,0x10,0x00,0x03,0x00,
0x00,0x00,0xa0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,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,�?�?�?�?�?�?�?�?�?�?�?�?

It is a text file, the 0x42 hexadecimal stuff is directly from Bitmap file. The [9174] can be [], i tried it that way.

I think it would be possible to do the conversion program myself, that is, by anyone.

Posted on June 03, 2017 at 16:44

To answer John Doe, There is an SD card holder in the 746 Discovery. I probably have to combine two examples to get that work.

To have bitmaps in the program memomory is easier for me now.