mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2024-10-03 18:18:46 -04:00
Fix merge conflict.
This commit is contained in:
commit
bf5ab389b5
@ -385,6 +385,24 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
|
||||
}
|
||||
}
|
||||
|
||||
//Draw XBitMap Files (*.xbm), exported from GIMP,
|
||||
//Usage: Export from GIMP to *.xbm, rename *.xbm to *.c and open in editor.
|
||||
//C Array can be directly used with this function
|
||||
void Adafruit_GFX::drawXBitmap(int16_t x, int16_t y,
|
||||
const uint8_t *bitmap, int16_t w, int16_t h,
|
||||
uint16_t color) {
|
||||
|
||||
int16_t i, j, byteWidth = (w + 7) / 8;
|
||||
|
||||
for(j=0; j<h; j++) {
|
||||
for(i=0; i<w; i++ ) {
|
||||
if(pgm_read_byte(bitmap + j * byteWidth + i / 8) & (1 << (i % 8))) {
|
||||
drawPixel(x+i, y+j, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if ARDUINO >= 100
|
||||
size_t Adafruit_GFX::write(uint8_t c) {
|
||||
#else
|
||||
|
@ -50,6 +50,8 @@ class Adafruit_GFX : public Print {
|
||||
int16_t w, int16_t h, uint16_t color),
|
||||
drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap,
|
||||
int16_t w, int16_t h, uint16_t color, uint16_t bg),
|
||||
drawXBitmap(int16_t x, int16_t y, const uint8_t *bitmap,
|
||||
int16_t w, int16_t h, uint16_t color),
|
||||
drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color,
|
||||
uint16_t bg, uint8_t size),
|
||||
setCursor(int16_t x, int16_t y),
|
||||
|
13
README.txt
13
README.txt
@ -1,3 +1,16 @@
|
||||
Current additions:
|
||||
|
||||
- XBitMap support (*.xbm)
|
||||
Use exported xbm files from GIMP with bitmap data directly in your sources.
|
||||
(fits perfectly with SSD1306 library from Adafruit)
|
||||
New function: Adafruit_GFX::drawXBitmap()
|
||||
Usage: Export bitmap with GIMP as *.xbm file,
|
||||
Rename the *.xbm to *.c,
|
||||
Open file in editor,
|
||||
Use C array directly in your sources.
|
||||
|
||||
----------------------------------
|
||||
|
||||
This is the core graphics library for all our displays, providing a common set of graphics primitives (points, lines, circles, etc.). It needs to be paired with a hardware-specific library for each display device we carry (to handle the lower-level functions).
|
||||
|
||||
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
|
||||
|
Loading…
Reference in New Issue
Block a user