Completely lost with loading bitmaps from progmem

I have been trying to load a bitmap onto my screen (ILI9341) for over a day without luck. I keep getting errors like drawBitmap is not declared in this scope even while I have the Adafruit GFX library installed. Could someone step by step me through this? I'll attach the bitmap below.

pixil-gif-drawing (1).gif

You have a 2-frame animated GIF. This is too complex for a Uno.

However you could store it as 2 frames of 50x50 RGBbitmap and use

void      drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[], int16_t w,
                    int16_t h),

This would require 50x50x2 bytes per frame i.e. 10000 bytes of PROGMEM
The GIF file ises compression. Your GIF requires a file size of 329 bytes.

Your file uses 5119 bytes. So I suspect it is an un-optimised GIF.

You could display it in with 4 separate mono bitmaps i.e. blue, black, red with

void      drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w,
                 int16_t h, uint16_t color, uint16_t bg),

This would use less PROGMEM memory.

David.

Sorry only posted it in gif form because bitmap wasn't supported. I tried what you said and I'm getting the problem of expected ',' or '...' before numeric constant.

void drawRGBBitmap(int16_t 0, int16_t 0, const uint16_t slime[1536], int16_t 32, int16_t 32)

Is this the right format? Can I drop the void and stick this somewhere else? Sorry for all the questions I'm new to displays. I'll add the array if you need it.

Do you want a single image?
Or images that change every 20ms?

In other words. Do you want the images from the specific GIF that you attached?

David.

I just want a single image to load where I want it and when I call it. I don't need it to change. If I want it to later then I can figure out how to with the basics of just having an image load. I'm mostly concerned with the formatting right now as all I get are errors when I try to add actual numbers to x, y, w, and h. And just to clarify is bg background? Thanks.

I have attached a sketch that illustrates drawBitmap() and drawRGBBitmap()

Note that the RGB images waste a massive amount of Flash memory.

David.

LlamaLeader_bitmap.zip (24.4 KB)

It works great thank you so much! Sorry I forgot to say in the beginning I have a Mega so RGB is a bit more feasible. Do you mind me asking what hex converter you used?

If you look at the bitmap files, it tells you.

There are many PC programs that will create a colour bitmap from BMP, PNG, JPG
Likewise, there are programs to create mono bitmaps from BMP, PNG, JPG.

Actually, the GIF was a bit complicated. IrfanView to extract the frames from the GIF. Then save as BMP files. Before using ImageConverter to create the raw pixel arrays.

Note that both colour and mono contain no geometry information. You have to "know" whether an image is 128x64 or 64x128 or 32x256 or ...
If you use a proper format e.g. JPG, BMP, ... the header will contain the info. The data will be compressed in JPG, PNG, GIF. Which requires cpu resources to decode. BMP is simple but enormous file size.

David.