diff options
| author | Manolo Gouy <Manolo> | 2010-05-27 17:20:18 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2010-05-27 17:20:18 +0000 |
| commit | 26049351e09d75bdf8b35273a76cf65202583fa7 (patch) | |
| tree | 010685555b9f83d071a14262e8ce346c7388f254 /src/Fl_Double_Window.cxx | |
| parent | 0a280ce591046f6834f1233087a72fa6bdd97bad (diff) | |
Better device hierarchy with surfaces and graphics drivers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7617 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Double_Window.cxx')
| -rw-r--r-- | src/Fl_Double_Window.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Fl_Double_Window.cxx b/src/Fl_Double_Window.cxx index 89f838844..bd2155329 100644 --- a/src/Fl_Double_Window.cxx +++ b/src/Fl_Double_Window.cxx @@ -28,6 +28,7 @@ #include <config.h> #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> +#include <FL/Fl_Printer.H> #include <FL/x.H> #include <FL/fl_draw.H> @@ -142,18 +143,24 @@ void fl_copy_offscreen(int x,int y,int w,int h,HBITMAP bitmap,int srcx,int srcy) DeleteDC(new_gc); } +//#include <FL/fl_ask.H> void fl_copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP bitmap,int srcx,int srcy) { HDC new_gc = CreateCompatibleDC(fl_gc); int save = SaveDC(new_gc); SelectObject(new_gc, bitmap); BOOL alpha_ok = 0; // first try to alpha blend - int to_display = Fl_Device::current()->type() < 256; // true iff display output - if ( (!to_display) || fl_can_do_alpha_blending()) // if not on display, always try alpha_blend + // if to printer, always try alpha_blend + int to_display = Fl_Surface_Device::surface()->type() == Fl_Display_Device::device_type; // true iff display output +//fl_alert("to_display=%d ",to_display); + if ( (to_display && fl_can_do_alpha_blending()) || Fl_Surface_Device::surface()->type() == Fl_Printer::device_type) { alpha_ok = fl_alpha_blend(fl_gc, x, y, w, h, new_gc, srcx, srcy, w, h, blendfunc); +//fl_alert("alpha_ok=%d",alpha_ok); + } // if that failed (it shouldn't), still copy the bitmap over, but now alpha is 1 - if (!alpha_ok) + if (!alpha_ok) { BitBlt(fl_gc, x, y, w, h, new_gc, srcx, srcy, SRCCOPY); + } RestoreDC(new_gc, save); DeleteDC(new_gc); } |
