From 355799ce0bbb078237dfc1ae9874bbc5342acbc4 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 17 Dec 2009 23:55:02 +0000 Subject: Merge branches/MarkieB/gtkmain to trunk. svn path=/trunk/netsurf/; revision=9729 --- image/ico.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'image/ico.c') 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, -- cgit v1.2.3