ImpulseAdventure / GUIslice

GUIslice drag & drop embedded GUI in C for touchscreen TFT on Arduino, Raspberry Pi, ARM, ESP8266 / ESP32 / M5stack using Adafruit-GFX / TFT_eSPI / UTFT / SDL
https://www.impulseadventure.com/elec/guislice-gui.html
MIT License
1.12k stars 206 forks source link

Images that use GSLC_IMGREF_FMT_RAW1 failed to display correctly #457

Closed Pconti31 closed 2 years ago

Pconti31 commented 2 years ago

I began working on a project where I wanted to use Monochromic images that use 1 bit per pixel. Seemed easy enough but in doing so I found a number of issues with first my utility GUIslice_Image2C, then GUIslice_Builder, and last but not least GUIslice API.

My GUIslice_Image2C created the C Array as 16 bit per pixel not the 1 bit I expected so while it displays just fine my 24x24 icon took up 1152 bytes instead of 72. Given I have many icons to display this wasn't what I wanted. A new GUIslice_Image2C version 2.00 will be posted soon that corrects this.

After fixing GUIslice_Image2C I tried to build a sample project using my 24x24 icon inside a file I called icon24.c. The Builder crashes and burns. So a new version of the Builder version 0.17.b11 will be posted soon.

Finally, I fire up my sample project with just a display of my 24x24 icon and I get the last third of the image displaying before the first 2/3. Ugh, not what I expected to say the least. I suspected t was my GUIslice_Image2C utilities fault so I wrote a quick test program using only Adafruit_GFX without GUIslice and its drawBitmap() function call with a slightly modified icon24.c and it displayed correctly. That left me debugging GUIslice_drv_adagfx::gslc_DrvDrawMonoFromMem(). The fix turns out to be needed in few other drivers. After further debugging and testing I have issued a pull request #456 to address this issue.

Paul--

ImpulseAdventure commented 2 years ago

Thank you Paul for checking in on the monochrome feature and uncovering the mods required to get it to operate as expected! It looks like we should be safe to proceed with the merge of #456 as the update was very minor.