diff --git a/README.md b/README.md index c514ce48..636493ce 100644 --- a/README.md +++ b/README.md @@ -402,6 +402,33 @@ OLEDDisplayUiState* getUiState(); int8_t update(); ``` +## Creating and using XBM bitmaps + +If you want to display your own images with this library, the best way to do this is using a bitmap. + +There are two options to convert an image to a compatible bitmap: +1. **Using Gimp.** + In this case exporting the bitmap in an 1-bit XBM format is sufficient. +2. **Using a converter website.** + You could also use online converter services like e.g. [https://javl.github.io/image2cpp/](https://javl.github.io/image2cpp/). The uploaded image should have the same dimension as the screen (e.g. 128x64). The following output settings should be set: + - Draw Mode: Horizontal - 1 bit per pixel + - Swap bits in byte: swap checkbox should be checked. + +The resulting bitmap can be put into a header file: +```C++ +const unsigned char epd_example [] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ... + ... +}; +``` + +Subsequently, it can be used like this: +```C++ +display.clear(); +display.drawXbm(0, 0, 128, 64, epd_example); // assuming your bitmap is 128x64 +display.display(); +``` + ## Example: SSD1306Demo ### Frame 1