This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Inserting an image into the lcd



hi,

I`m using the tms570 MCU Develompmet kit (mcbtms570) and I want to "insert" an image on the lcd.

I changed the format of my image to bmp, and then I used the convert tool that brings the confidence_test example: Confidence_test\Source\Images\Convert image.

It generates a image.c file but the image that appears on the lcd doesn´t mach with the original.

In the program, the only thing that I did was to declare my image and in the place that it was the texas instrumet logo: (confident_test.c)

static void Main_Menu_Screen(void) {

 

.

.

GLCD_Bmp ( 5, 5, 118, 30, TI_Logo_16bpp +70);

.

}

change TI_Logo_16bpp and put my "image_16bpp".

Doesn´t Work.

I opened the image_16bpp.c and the code seems to be alright...

I proved to put in that place an already existing logo, like this:

 

 

 

 

 

 

static

 

 

void Main_Menu_Screen(void

) {

 

GLCD_Clear(White);

 

// clear LCD screen

 

 

// draw logos and touch screen buttons on the screen

GLCD_Bmp ( 5, 5, 118, 30, Keil_Logo_16bpp +70);//here the difference!

GLCD_Bmp ( 213, 5, 94, 30, Keil_Logo_16bpp +70);

GLCD_Bmp ( 5, 60, 150, 50, Button_TmpLight_16bpp +70);

GLCD_Bmp ( 5, 120, 150, 50, Button_SDCard_16bpp +70);

GLCD_Bmp ( 5, 180, 150, 50, Button_Memory_16bpp +70);

GLCD_Bmp ( 165, 60, 150, 50, Button_Air_16bpp +70);

GLCD_Bmp ( 165, 120, 150, 50, Button_Solenoid_16bpp +70);

GLCD_Bmp ( 165, 180, 150, 50, Button_Sensors_16bpp +70);

 

PageSelector = CheckForTouch(&MainTouch[0], 1);

 

// wait for ever until one of the touch buttons are selected

so I supposse to saw the keil logo twice, the first one in the left side, and the second on the right, but I only see the second correctly. Why????

I did an other try and I change the size of the logo to be the same of the original:

GLCD_Bmp ( 5, 5, 94, 30, Keil_Logo_16bpp +70);

 

GLCD_Bmp ( 213, 5, 94, 30, Keil_Logo_16bpp +70);

Like this both has vertically 94 and horizantaly 25.

Doesn´t works, the first image always is incorrect. Very incorrect.

So I don´t know why or where I miss. My questions are:

1. The convert image file that brings the example does a good work? The .c file is useful?  (i used other convertors to, but no one gave me a good result)

2. If the converted c code it is correct, why do I not see the image correctly?

3. I change the place of the logos and doesn´t works... do I have to change something more in the program?

Please, if you know the steps for inserting an image explained to me.

Thanks,

David

 

 

 

  • Hello David,

     

    I hope my answer is not too late. First of all create your *.BMP image e.g. with GIMP (freeware) in a 16bit 565 format. Then you can convert it like you just did with the BIN2C.exe. from the Confidence_test project. To insert the image correctly, you have to write the size into your source code. So if the logo has vertically 25 and horizontally 94, write

    GLCD_Bmp (5, 5, 94, 25, Keil_Logo_16bpp +70);

    to place it into the left upper corner. To change the position change the x (horizontally) and y (vertically) coodinates.

    GLCD_Bmp (x, y, 94, 25, Keil_Logo_16bpp +70);

     

    Regards,

     

    Joris