summaryrefslogtreecommitdiff
path: root/src/Fl_Pixmap.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_Pixmap.cxx')
-rw-r--r--src/Fl_Pixmap.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index 9b2cfcdd2..a3fad728a 100644
--- a/src/Fl_Pixmap.cxx
+++ b/src/Fl_Pixmap.cxx
@@ -43,6 +43,10 @@
#include "flstring.h"
#include <ctype.h>
+#ifdef WIN32
+extern void fl_release_dc(HWND, HDC); // located in Fl_win32.cxx
+#endif
+
#ifdef __APPLE_QUARTZ__
extern Fl_Offscreen fl_create_offscreen_with_alpha(int w, int h);
#endif
@@ -108,10 +112,12 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
#ifdef WIN32
if (mask) {
HDC new_gc = CreateCompatibleDC(fl_gc);
+ int save = SaveDC(new_gc);
SelectObject(new_gc, (void*)mask);
BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCAND);
SelectObject(new_gc, (void*)id);
BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCPAINT);
+ RestoreDC(new_gc,save);
DeleteDC(new_gc);
} else {
fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy);