From 36cd0a397c6d8fee7ffc5b59d607ead523226e53 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 28 Nov 2022 17:26:37 +0100 Subject: New Fl_ICO_Image class to read Windows .ico icon files Many thanks to @darealshinji for contributing all the code for this new FLTK image class (see branch Fl_ICO_Image of https://github.com/darealshinji/fltk). --- src/fl_images_core.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/fl_images_core.cxx') diff --git a/src/fl_images_core.cxx b/src/fl_images_core.cxx index 07224fa31..5c2a7e98b 100644 --- a/src/fl_images_core.cxx +++ b/src/fl_images_core.cxx @@ -2,7 +2,7 @@ // FLTK images library core. // // Copyright 1997-2010 by Easy Software Products. -// Copyright 2011-2021 by Bill Spitzak and others. +// Copyright 2011-2022 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -95,6 +96,9 @@ fl_check_images(const char *name, // I - Filename if (memcmp(header, "BM", 2) == 0) // BMP file return new Fl_BMP_Image(name); + if (memcmp(header, "\0\0\1\0", 4) == 0 && header[5] == 0) // ICO file + return new Fl_ICO_Image(name); + // PNM if (header[0] == 'P' && header[1] >= '1' && header[1] <= '7') -- cgit v1.2.3