Draw color bitmap - Adafruit_mfGFX

I’m trying to draw a color bitmap with the Adafruit_mfGFX and Adafruit_ST7735 lib which I think @peekay123 ported??

I used this link to convert the image to a color bitmap array, but the libary only has a function to draw a bitmap where you have to tell it the color to use. I was hoping there was a function like drawBitmap256K and it would use the colors in the bitmap array?? Or is there some other lib to use to accomplish this?

static const unsigned char flameon2[]{…};

Current function:

drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color)

Would like:

drawBitmap256K(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *bitmap) 


In my Adafruit_HX8357 library (on Web IDE) you can find a demo called SPITFTBITMAP that contains a void bmpDraw(char *filename, uint8_t x, uint16_t y) which takes a bitmap file from SD and pushes it to the display.
If you strip this down to use your bitmap array instead of a file, you might have what you’re looking for.

The function I borrowed of the original SPITFTBITMAP demo from Adafruit :wink:

@ScruffR, I’ll see if I can do that. My c skill are way rusty and I have never worked with bitmaps before so this could be interesting :smile:

1 Like

If you need some assistance, you know where to find us :smile: - it shouldn’t be too hard to understand and alter for your needs.

Be confident :+1:

@xcode, did you ever get something working ?

Sorry missed this. No, I couldn’t quite figure it out.