From 14f0bca18450e19e8f8a0cd69119331284876693 Mon Sep 17 00:00:00 2001 From: Ramon Date: Wed, 12 Jul 2023 09:36:56 +0200 Subject: [PATCH 1/2] Improved README: added section about bitmaps As mentioned in #378 documentation for using bitmaps with this project is needed. --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index c514ce4..d32fa55 100644 --- a/README.md +++ b/README.md @@ -402,6 +402,33 @@ OLEDDisplayUiState* getUiState(); int8_t update(); ``` +## Creating and using a Bitmap + +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 a converter website like [this one](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 From 1b7bf0e4e37d6075ca2e1a719a793f61b38caec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Wed, 12 Jul 2023 11:20:37 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d32fa55..636493c 100644 --- a/README.md +++ b/README.md @@ -402,7 +402,7 @@ OLEDDisplayUiState* getUiState(); int8_t update(); ``` -## Creating and using a Bitmap +## 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. @@ -410,7 +410,7 @@ 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 a converter website like [this one](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: + 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.