summaryrefslogtreecommitdiff
path: root/src/Fl_Pixmap.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-09-12 23:03:34 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-09-12 23:03:34 +0000
commit2b6586f64d4c49a3a3858ce52182610d5b77fbd0 (patch)
treee11963920650a6269ad6c911b026f39ecc4024ec /src/Fl_Pixmap.cxx
parent55380298b5cda84acb862ef5b87023d8f6b51232 (diff)
STR #1007: Applied second patch by hand. OP: could you please check if all changes were made correctly? Thanks!
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4563 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
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);