Hi..I have a question for those who tryed to display a picture using this library..My setup is this..Mega 2560 and a serial ITDB2.2..Tests runs fine, but when I want to upload a photo, I"m getting the folowing error..."size of array is too large"...ok..I resized the picture using Bitmap, then I had used the ImageConverter565 provided with the library...For now, the single size array which didn't get me an error was a [0x690] array, with 3360 bytes and a size for the picture 48x35 pixels....too small to be readable.. :)...The TFT I'm using has a 220x176 pixels resolution, so I want to use all the screen for this picture to be displayed...What is the max array size supported and how can I resize the image for proper displaying?
Up!
Hello,
I'm having exactly the same problem than what was described.
If you found the way to get it working, please let me know
and?
It is a feature of the AVR C++ compiler. An array of any type must be less than 32768 bytes.
e.g. an array of 16383 uint16_t pixels.
You can split the image into multiple smaller arrays. Than display all the "sub-images" with the regular
void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int scale=1);
For a 320x240 image, you can display in five 320x48 strips.
Be realistic. Each 320x240 would use 153kB Flash. i.e. you can only fit one image into Flash.
If you want to display a few colour photos from Flash, store as "lossy" JPG images. In practice a 90% or 95% JPG might fit in 32kB array. You can get several JPGs in the 256kB Flash.
A Mega2560 is a "bit slow" when decoding JPG from Flash but probably faster than reading a BMP or RAW image from SD card.
Life is much simpler with a proper ARM or ESP32 mcu.
David.