Display BMP images on TFT 240 * 320 ILI9341

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi recently I have been working on TFT INI9341 and facing problem with displaying bmp images on TFT screens. Library that I used is https://www.hackster.io/rayburne/psoc-4-using-the-color-glcd-ili9341-8c92f5 and it works perfectly fine for other things, but in case of displaying bmp its behaving bit weired, I spent entire day figuring out strange behaviour. Either I am using wrong converter which is http://hobby-research.at.ua/load/utility/grafika/bitmap2code/9-1-0-22 or there is something else. I get very weiredo image on display,, half here half there. Also attaching BMP image along with the library. I don't know whats wrong there. I think it is converter. If anybody here was able to display a bmp successfully

   

1) What convertor do you use ? I can smell there is some issue with my convertor. Bitmap2code link already shared

   

2) How you were able to display ?

0 Likes
4 Replies
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

I use LCD assistant and have converted your done file.

0 Likes
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Here is another LCD program.  Should work it is setup for a CY8CKIT-049-42XX board but you can convert it to the PSOC Ble board by changing the Device in the Device selector in Psoc Creator.

0 Likes
Anonymous
Not applicable

Thanks for uploading this code. I have same library and it's BMP display functions is correct as stated in comment below.

   

Thanks again for your swift response.

0 Likes
Anonymous
Not applicable

Hello Bob thanks for conversion, but I use 16 bpp and that option was not available in LCD assistant. Regarding your LCD program, now I am able to find problem area in my case. Its with BMP2C convertor. How I find it that is interesting. I was seeing a pattern int the image displayed after convertion. In that image was filling in a pattern like it was devviding rectangle into half by diagonals and first filling X-axis on right side of line then left. I wrote a basic C code and re-arranged the array as shown below and now its working. It is not a permanent solution just temporary one, to find the problem area. And BMP2C converter is problem area here (don't know why it is converting like that. I wasted my entire day downloading different converters. Tomorrow I will write my own BMP2C converter application. Till then if anybody faces similar problem he/she can use this code.

   

#define X_AXIS 50

   

#define Y_AXIS 50

   

void RearrangeArray()
{
    uint16 u16xx, u16yy,u16Index,u16Actual=0, u16array[2500];
    u16xx=X_AXIS-1;
        for(u16yy=0; u16yy < Y_AXIS; u16yy++)
        {
            for(u16Index=u16xx; u16Index< X_AXIS; u16Index++)
            {
                u16array[u16Actual]=ImageArray[u16yy][u16Index];
                u16Actual++;
            }

   

            for(u16Index=0; u16Index< u16xx; u16Index++)
            {
                u16array[u16Actual]=ImageArray[u16yy][u16Index];
                u16Actual++;
            }
            u16xx--;
        }
        
        TFT_FillBitmap(50, 100, 50,100, (unsigned short *) u16array);
    
            
}

   

Converted my imageArray [2500] to 2-d array as ImageArray[50][50];

   

PS -  This is a temporary solution to check library. 

0 Likes