diff options
Diffstat (limited to 'image')
-rw-r--r-- | image/ico.c | 12 | ||||
-rw-r--r-- | image/ico.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/image/ico.c b/image/ico.c index 5416e612a..e2fce245a 100644 --- a/image/ico.c +++ b/image/ico.c @@ -115,6 +115,18 @@ bool nsico_redraw(struct content *c, int x, int y, background_colour, BITMAPF_NONE); } +/** sets the bitmap for an ico according to the dimensions */ + +bool nsico_set_bitmap_from_size(struct content *c, int width, int height) +{ + struct bmp_image *bmp = ico_find(c->data.ico.ico, width, height); + if (bmp == NULL) + return false; + if ((bmp->decoded == false) && (bmp_decode(bmp) != BMP_OK)) + return false; + c->bitmap = bmp->bitmap; + return true; +} bool nsico_redraw_tiled(struct content *c, int x, int y, int width, int height, diff --git a/image/ico.h b/image/ico.h index cd7b0b432..f3686c0c5 100644 --- a/image/ico.h +++ b/image/ico.h @@ -48,6 +48,7 @@ bool nsico_redraw_tiled(struct content *c, int x, int y, int clip_x0, int clip_y0, int clip_x1, int clip_y1, float scale, colour background_colour, bool repeat_x, bool repeat_y); +bool nsico_set_bitmap_from_size(struct content *c, int width, int height); #endif /* WITH_BMP */ |