diff options
Diffstat (limited to 'src/Fl_Pixmap.cxx')
| -rw-r--r-- | src/Fl_Pixmap.cxx | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx index 0bb602e8e..d20132a35 100644 --- a/src/Fl_Pixmap.cxx +++ b/src/Fl_Pixmap.cxx @@ -152,37 +152,20 @@ void Fl_Pixmap::generic_device_draw(int XP, int YP, int WP, int HP, int cx, int if(hMod) fl_TransparentBlt = (fl_transp_func)GetProcAddress(hMod, "TransparentBlt"); } if (hMod) { -# define UNLIKELY_RGB_COLOR 2,3,4 // a nearly black color unlikely to occur in pixmaps -# define WIN_COLOR RGB(2,3,4) Fl_Offscreen tmp_id = fl_create_offscreen(w(), h()); fl_begin_offscreen(tmp_id); uchar *bitmap = 0; fl_mask_bitmap = &bitmap; - // draw pixmap to offscreen using the unlikely color for background - fl_draw_pixmap(data(), 0, 0, fl_rgb_color(UNLIKELY_RGB_COLOR) ); + // draw pixmap to offscreen + fl_draw_pixmap(data(), 0, 0); fl_end_offscreen(); HDC new_gc = CreateCompatibleDC(fl_gc); int save = SaveDC(new_gc); SelectObject(new_gc, (void*)tmp_id); - // print all of offscreen but its parts using unlikely color - fl_TransparentBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, w(), h(), WIN_COLOR ); + // print all of offscreen but its parts in background color + extern UINT win_pixmap_bg_color; // computed by fl_draw_pixmap() + fl_TransparentBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, w(), h(), win_pixmap_bg_color ); RestoreDC(new_gc,save); - // This is an approximate algorithm that fails to print pixmap pixels that would use the unlikely color. - // It can be transformed into an exact algorithm by adding the following commented out statements - // that print pixmap one more time hiding another color (any color would fit) - /* -# define UNLIKELY_RGB_COLOR2 4,3,2 -# define WIN_COLOR2 RGB(4,3,2) - { - fl_begin_offscreen(tmp_id); - fl_draw_pixmap(data(), 0, 0, fl_rgb_color(UNLIKELY_RGB_COLOR2) ); - fl_end_offscreen(); - } - save = SaveDC(new_gc); - SelectObject(new_gc, (void*)tmp_id); - fl_TransparentBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, w(), h(), WIN_COLOR2 ); - RestoreDC(new_gc,save); - */ DeleteDC(new_gc); fl_delete_offscreen(tmp_id); } |
