diff options
| author | Manolo Gouy <Manolo> | 2010-07-09 17:31:33 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2010-07-09 17:31:33 +0000 |
| commit | 8306c3d0b31d4e60a9ba9c4d0ca4ed6a32226de1 (patch) | |
| tree | 03b7946071d9ded7cdc647da9a88b6414b3e9897 /FL/win32.H | |
| parent | 0ac2bc4d40209005b37931bc4541c2af777635fa (diff) | |
Fixed fl_XXX_offscreen functions when the current output goes to a printer or a PostScript device
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7671 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/win32.H')
| -rw-r--r-- | FL/win32.H | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/FL/win32.H b/FL/win32.H index 8ad6ccf45..cd9233179 100644 --- a/FL/win32.H +++ b/FL/win32.H @@ -121,16 +121,19 @@ extern FL_EXPORT void fl_save_dc( HWND w, HDC dc); // off-screen pixmaps: create, destroy, draw into, copy to window typedef HBITMAP Fl_Offscreen; -#define fl_create_offscreen(w, h) CreateCompatibleBitmap(fl_gc, w, h) +#define fl_create_offscreen(w, h) \ + CreateCompatibleBitmap( (fl_gc ? fl_gc : fl_GetDC(0) ) , w, h) extern FL_EXPORT HDC fl_makeDC(HBITMAP); # define fl_begin_offscreen(b) \ HDC _sgc=fl_gc; Window _sw=fl_window; \ + Fl_Surface_Device *_ss = fl_surface; fl_display_device->set_current(); \ fl_gc=fl_makeDC(b); int _savedc = SaveDC(fl_gc); fl_window=(HWND)b; fl_push_no_clip() # define fl_end_offscreen() \ - fl_pop_clip(); RestoreDC(fl_gc, _savedc); DeleteDC(fl_gc); fl_window=_sw; fl_gc = _sgc + fl_pop_clip(); RestoreDC(fl_gc, _savedc); DeleteDC(fl_gc); _ss->set_current(); fl_window=_sw; fl_gc = _sgc + FL_EXPORT void fl_copy_offscreen(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy); FL_EXPORT void fl_copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy); |
