Bitmap class to load a Windows BMP into a SSD1351 OLED display
- Reads 16/24 bits Windows BMP (uncompressed)
- Compatible with Adafruit_SSD1351 driver
- Adafruit_SSD1351_Photon
- Adafruit_mfGFX
- SdFat
char *filename` // path to a Windows BMP _16bits_ file on your SDCard
Adafruit_SSD1351 display(...) // your current display
setup() {
Bitmap bitmap = Bitmap(&display,filename);
bitmap.draw(x,y);
...
SdFile bmpFile;
bmpFile.open(filename, O_READ);
Bitmap bitmap2 = Bitmap(&display,bmpFile);
bitmap2.draw(x,y);
}
- image is loaded into memory first, then written to display ram through SPI
- because of the use of display SPI commands, the code won't work as is with another type of display
- if you use custom fonts (e.g. Arial8) within your project, you have to copy this library locally and update fonts.h accordingly
- Reading compressed formats
- Reading 32bits BMP files
- Reading PNG and JPG files
- use callbacks for display off/on, to make it compatible with the GFX lib, rather than the hardware display driver
- 0.0.2: removed serial linefeeds sent while loading the picture
- 0.0.3: color fix (0.0.2 was not working) + handling 24 bits bitmaps + loading pictures in memory, then writing to display ram directly
- 0.0.4: fixed dependencies
- 0.0.5: fixed R,G,B order inversion in 24bits bitmaps :/