summaryrefslogtreecommitdiff
path: root/src/fl_images_core.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-11-28 17:26:37 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-12-09 10:43:20 +0100
commit36cd0a397c6d8fee7ffc5b59d607ead523226e53 (patch)
tree91f0bd3628ae3d7b7553706b24b66b1bb4620c6b /src/fl_images_core.cxx
parent0bb30d8f92839af826fb389fccd625c74e981a13 (diff)
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).
Diffstat (limited to 'src/fl_images_core.cxx')
-rw-r--r--src/fl_images_core.cxx6
1 files changed, 5 insertions, 1 deletions
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 <FL/Fl_PNG_Image.H>
#include <FL/Fl_PNM_Image.H>
#include <FL/Fl_SVG_Image.H>
+#include <FL/Fl_ICO_Image.H>
#include <FL/fl_utf8.h>
#include <stdio.h>
#include <stdlib.h>
@@ -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')