mirror of
https://github.com/fltk/fltk.git
synced 2026-05-21 22:51:41 +08:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user