You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quantum Painter Drawing API > Image Functions > Draw Image has the following example code:
// Draw an image on the bottom-right of the 240x320 display on initialisationstaticpainter_image_handle_tmy_image;
voidkeyboard_post_init_kb(void) {
my_image=qp_load_image_mem(gfx_my_image);
if (my_image!=NULL) {
qp_drawimage(display, (239-my_image->width), (319-my_image->height), my_image);
}
}
This example code will actually display an image 1 pixel up-left of the bottom-right corner of the 240x320 display. Additionally, it will cause uint16_t overflow for images the same size as the display. To correct this, it should be changed to the following:
// Draw an image on the bottom-right of the 240x320 display on initialisationstaticpainter_image_handle_tmy_image;
voidkeyboard_post_init_kb(void) {
my_image=qp_load_image_mem(gfx_my_image);
if (my_image!=NULL) {
qp_drawimage(display, (240-my_image->width), (320-my_image->height), my_image);
}
}
I have confirmed this uint16_t overflow behavior using a 96x24 test image with a SteelSeries Prime+ which has a 96x24 display.
Issue Description
Quantum Painter Drawing API > Image Functions > Draw Image
has the following example code:This example code will actually display an image 1 pixel up-left of the bottom-right corner of the 240x320 display. Additionally, it will cause
uint16_t
overflow for images the same size as the display. To correct this, it should be changed to the following:I have confirmed this
uint16_t
overflow behavior using a 96x24 test image with a SteelSeries Prime+ which has a 96x24 display.In addition to this issue on
Quantum Painter Drawing API > Image Functions > Draw Image
, similar issues exist for example code under:Quantum Painter Drawing API > Image Functions > Animate Image
Quantum Painter Drawing API > Font Functions > Draw Text
Link to docs page: https://docs.qmk.fm/quantum_painter#quantum-painter-api
The text was updated successfully, but these errors were encountered: