summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2009-04-27 15:51:21 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2009-04-27 15:51:21 +0000
commit5a8e28d30b0b69d870e68b4d461a1914728a2cbe (patch)
tree1bc5a0f9c58f8119e986240efd4ed7293dbf894c /fluid
parentdb7af4a8eb3186b85063b320305b96320370a70b (diff)
Fluid printing used wrong colors under Windows (STR #2195)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6784 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid')
-rw-r--r--fluid/fluid.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx
index 575541dbe..fb48bcd33 100644
--- a/fluid/fluid.cxx
+++ b/fluid/fluid.cxx
@@ -1018,6 +1018,14 @@ void print_menu_cb(Fl_Widget *, void *) {
win = (Fl_Window *)(windows[winpage]->o);
pixels = windows[winpage]->read_image(w, h);
+ // Swap colors: FLTK uses R-G-B --> Windows GDI uses B-G-R
+
+ { uchar *p = pixels;
+ for (int i=0; i<w*h; i++, p+=3) {
+ uchar temp = p[0]; p[0] = p[2]; p[2] = temp;
+ }
+ }
+
// Figure out the window size, first at 100 PPI and then scaled
// down if that is too big...
ww = w * xdpi / 100;