Go Down

Topic: How to load BMP to flash memory on a 3.5 TFT display (Read 361 times) previous topic - next topic

Stumpy_L

OK David

I've played around with the logo, in a couple of different photo editors. tried going from 16 m colors to 16 to 256, changed the pixel size and for the most part when I put it back to 16m, the only format the TFT will display, the file size is 134KB's. I've settled on a black and white version with dimensions of 421 x 109.

As  mentioned I would prefer to load the BMP into the flash on the TFT display but I have not been able to get any info on doing that or even the flash memory size from Adafruit, actually the first time I have not been able to get an answer from them.

You had mentioned loading into the flash on the mega. I assume, because I don't know, that would be the same memory that the complied sketch goes into. When I compile the current sketch it tells me I have used 12%, 32,142 bytes of 253,952 bytes max. Will that be where the BMP will go? Will the 134KB of the BMP compile to less than that?  My program is mostly complete but I may not want to use up a lot of memory just for a bit map.

Thanks
John

Stumpy_L

I have been getting some tremendous help with this issue from a tesla member, and hopefully he will continue to help. This is a great forum, I have had many issues resolved by this community.

Also I have learnt, by a reply to this same issue that I posted on the Adafruit forum, that the flash memory is on the TFT display, it is not it is in the controller. As the tesla member had said that was where he would show me how to load my bit map.

I'm a typical engineer who doesn't read the directions well

Thanks

david_prentice

I was expecting you to play in IrfanView.  And produce a set of BMP files to view on PC or TFT

Anyway,  I have done it for you.
Code: [Select]

12-Nov-19  08:50            92,050 BMP_16.bmp
12-Nov-19  08:40             6,166 logo2_1.bmp
12-Nov-19  09:21             6,166 logo2_1C.bmp
12-Nov-19  09:21           137,830 logo2_1Cx24.bmp
12-Nov-19  08:41           137,830 logo2_1x24.bmp
12-Nov-19  08:10           137,830 logo2_24.bmp
12-Nov-19  08:13            23,226 logo2_4.bmp
12-Nov-19  08:13           137,830 logo2_4x24.bmp
12-Nov-19  08:11            47,294 logo2_8.bmp
12-Nov-19  08:12           137,830 logo2_8x24.bmp

The files with "24" in the name are 24-bit colour.  And your BMP program should show them on the TFT.

Personally,  I would choose the 16-color logo2_4x24.bmp
It is anti-aliased.   The curves look nice.   It takes 23kB of Flash.   And a complex function to display it (which will take a few kB of Flash).

OTOH,  the 2-color logo2_1Cx24.bmp does not look too bad (from a distance)
It is only the monochrome logo2_1x24.bmp from IrfanView with the BLACK color replaced with your "special Blue"

You can create a GFX bitmap via online sites e.g. http://skaarhoj.com/FreeStuff/GraphicDisplayImageConverter.php

And display it with regular Adafruit_GFX methods.   Even specifying your White foreground and "special Blue" background colours.

David.

Stumpy_L

David

Thanks so much for all of your work. I obviously misunderstood that you wanted me to create all the different types of files, see my previous post about not understanding where the flash memory was. Also I was unfamiliar with IrfanView and didn't spend enough time to learn more. I will become more familiar with it.

I will play around with the files tonight and see what I can do.

Thanks again for your help and patience
John

david_prentice

I was not really expecting you to create all those files.

Just start with original 24-bit logo2_24.bmp.
Make 8-bit, 4-bit, 1-bit images on the PC.
Observe the appearance on the PC.
Choose the two "best".   Save in 24-bit BMP.  Copy to your SD card.

Then observe the appearance on the TFT.

4-bit (16-color) looks perfect.
But 1-bit (2-color) does not look too bad.

I am amazed by how good a 16-color palette works even with some colour photos.
And how good a 4-bit Grayscale (16 shades) looks on a TFT or OLED.

David.

Stumpy_L

Ya Hoo! got it to load the logo into the flash, looks good. I went with the black and white 24 color file, logo2_1x24.bmp. I'm filling the screen with black first, loading in the logo then a couple of buttons I use to get to other screens. Looks better with black on black, no two tone. At first I did it with white text but have changed it to cyan. Looks really sharp. 

Now onto getting the datalogger incorporated into this project. I've had it working by itself.

I can't thank you for all your help and coaching, I've really learnt a lot and that's part of the fun

Thanks again
John

Go Up