From 4b6dfbfb4c674b74848b5583e079aa083da66cb5 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 17 Nov 2016 13:52:16 +0000 Subject: WIN32 platform: Fix drawing of depth-4 scaled image when can_do_alpha_blending() is false. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12116 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index a0ef3815d..8d3ba61e1 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -527,13 +527,14 @@ int Fl_GDI_Printer_Graphics_Driver::draw_scaled(Fl_Image *img, int XP, int YP, i int Fl_GDI_Graphics_Driver::draw_scaled(Fl_Image *img, int XP, int YP, int WP, int HP) { Fl_RGB_Image *rgb = img->as_rgb_image(); if (!rgb || !rgb->array) return 0; // for bitmaps and pixmaps + if ((rgb->d() % 2) == 0 && !can_do_alpha_blending()) return 0; if (!*Fl_Graphics_Driver::id(rgb)) *Fl_Graphics_Driver::id(rgb) = (fl_uintptr_t)build_id(rgb, (void**)(Fl_Graphics_Driver::mask(rgb))); HDC new_gc = CreateCompatibleDC(gc_); int save = SaveDC(new_gc); SelectObject(new_gc, (HBITMAP)*Fl_Graphics_Driver::id(rgb)); - if ((img->d() % 2) == 0 && can_do_alpha_blending()) { + if ( (rgb->d() % 2) == 0 ) { alpha_blend_(XP, YP, WP, HP, new_gc, 0, 0, rgb->w(), rgb->h()); } else { SetStretchBltMode(gc_, HALFTONE); -- cgit v1.2.3