diff options
Diffstat (limited to 'image/ico.c')
-rw-r--r-- | image/ico.c | 12 |
1 files changed, 12 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, |