Author: manolo
Date: 2010-03-04 07:14:36 -0800 (Thu, 04 Mar 2010)
New Revision: 7211
Log:
Print WIN32 pixmaps with white background, better than black we had before.

Modified:
   branches/branch-1.3-Fl_Printer/src/Fl_Pixmap.cxx

Modified: branches/branch-1.3-Fl_Printer/src/Fl_Pixmap.cxx
===================================================================
--- branches/branch-1.3-Fl_Printer/src/Fl_Pixmap.cxx    2010-03-04 11:52:18 UTC 
(rev 7210)
+++ branches/branch-1.3-Fl_Printer/src/Fl_Pixmap.cxx    2010-03-04 15:14:36 UTC 
(rev 7211)
@@ -144,7 +144,17 @@
     fl_restore_clip();
   }
 #elif defined(WIN32)
-  if (mask) {
+  if (fl_device->type() == Fl_Device::gdi_printer) { // print with white 
instead of transparent background
+    Fl_Offscreen tmp_id = fl_create_offscreen(w(), h());
+    fl_begin_offscreen(tmp_id);
+    uchar *bitmap = 0;
+    fl_mask_bitmap = &bitmap;
+    fl_draw_pixmap(data(), 0, 0, FL_WHITE );
+    fl_end_offscreen();
+    fl_copy_offscreen(X, Y, W, H, tmp_id, cx, cy);
+    fl_delete_offscreen(tmp_id);
+  }
+  else if (mask) {
     HDC new_gc = CreateCompatibleDC(fl_gc);
     int save = SaveDC(new_gc);
     SelectObject(new_gc, (void*)mask);

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to