diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2004-10-18 20:22:25 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2004-10-18 20:22:25 +0000 |
| commit | bf910884ccd3b3fb0655799feee83adcbc35a3a9 (patch) | |
| tree | e48c4008467d4320381e26027b79fda5a410dc5d /src/Fl_PNG_Image.cxx | |
| parent | f7fd28ddfc97f5ff289ad6e916d012848583c192 (diff) | |
Documentation updates (STR #570)
Added DESTDIR support and now remove all man pages for the
"uninstall" target (STR #545)
Fix PNG drawing on buggy WIN32 graphics cards (STR #548)
The configure script didn't propagate the CPPFLAGS environment
variable (STR #549)
The numpad keys didn't work properly on WIN32 (STR #502)
fl_input() and friends now set the input focus to the text field
when the dialog is shown (STR #553)
Fixed background color mixup when drawing Fl_Choice menus (STR
#544)
Fixed MingW makefiles (STR #550)
More VC++ project file tweaking (STR #559)
Fl_PNG_Image didn't use the png_set_trns_to_alpha function when
available (STR #547)
The FL_UNFOCUS event wasn't always sent when switching tabs (STR
#558)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3868 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_PNG_Image.cxx')
| -rw-r--r-- | src/Fl_PNG_Image.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/Fl_PNG_Image.cxx b/src/Fl_PNG_Image.cxx index 61e4c4f9f..d9ddaeff4 100644 --- a/src/Fl_PNG_Image.cxx +++ b/src/Fl_PNG_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_PNG_Image.cxx,v 1.1.2.11 2004/04/11 04:38:58 easysw Exp $" +// "$Id: Fl_PNG_Image.cxx,v 1.1.2.12 2004/10/18 20:22:24 easysw Exp $" // // Fl_PNG_Image routines. // @@ -108,11 +108,11 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read else if (info->bit_depth == 16) png_set_strip_16(pp); -# if defined(HAVE_PNG_GET_VALID) && defined(HAVE_SET_TRNS_TO_ALPHA) +# if defined(HAVE_PNG_GET_VALID) && defined(HAVE_PNG_SET_TRNS_TO_ALPHA) // Handle transparency... if (png_get_valid(pp, info, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(pp); -# endif // HAVE_PNG_GET_VALID && HAVE_SET_TRNS_TO_ALPHA +# endif // HAVE_PNG_GET_VALID && HAVE_PNG_SET_TRNS_TO_ALPHA array = new uchar[w() * h() * d()]; alloc_array = 1; @@ -127,6 +127,16 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read for (i = png_set_interlace_handling(pp); i > 0; i --) png_read_rows(pp, rows, NULL, h()); +#ifdef WIN32 + // Some Windows graphics drivers don't honor transparency when RGB == white + if (channels == 4) { + // Convert RGB to 0 when alpha == 0... + uchar *ptr = (uchar *)array; + for (i = w() * h(); i > 0; i --, ptr += 4) + if (!ptr[3]) ptr[0] = ptr[1] = ptr[2] = 0; + } +#endif // WIN32 + // Free memory and return... delete[] rows; @@ -139,5 +149,5 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read // -// End of "$Id: Fl_PNG_Image.cxx,v 1.1.2.11 2004/04/11 04:38:58 easysw Exp $". +// End of "$Id: Fl_PNG_Image.cxx,v 1.1.2.12 2004/10/18 20:22:24 easysw Exp $". // |
