@aiggya, have you ever read the README.md of my library?
// write to controller memory, with screen refresh; x and w should be multiple of 8
void drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false)
{
epd2.drawImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
}
GxEPD2_BW.h line 510.
It should be obvious, that it will be replaced by the content of the graphics buffer on next full screen update.
You could use partial window update to update part of a "background" image, but this is not the ideal solution to what you want to achieve.
You should use a drawBitmap method to "draw" you picture to the graphics buffer.
See in Adafruit_GFX.h e.g. line 84..91:
void drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w,
int16_t h, uint16_t color);
void drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w,
int16_t h, uint16_t color, uint16_t bg);
void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h,
uint16_t color);
void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h,
uint16_t color, uint16_t bg);
See also e.g. GxEPD2_Example.ino line 975
#ifdef _GxBitmaps104x212_H_
void drawBitmaps104x212()
{
#if !defined(__AVR)
const unsigned char* bitmaps[] =
{
WS_Bitmap104x212, Bitmap104x212_1, Bitmap104x212_2, Bitmap104x212_3
};
#else
const unsigned char* bitmaps[] =
{
WS_Bitmap104x212, Bitmap104x212_1, Bitmap104x212_2, Bitmap104x212_3
};
#endif
if ((display.epd2.WIDTH == 104) && (display.epd2.HEIGHT == 212) && !display.epd2.hasColor)
{
for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
{
display.firstPage();
do
{
display.fillScreen(GxEPD_WHITE);
display.drawBitmap(0, 0, bitmaps[i], 104, 212, GxEPD_BLACK);
}
while (display.nextPage());
delay(2000);
}
}
}
#endif
For your combined result, you should place all commands for buffered drawing in the same page loop.