From d0f6ef5d3207d39b5209a608117d3078e40acb39 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 16 Dec 2016 16:06:07 +0000 Subject: Improve Fl_Graphics_Driver::copy_offscreen() so it accepts an Fl_Offscreen argument even if not created by fl_create_offscreen(). With this, fl_copy_offscreen() can be used with any drawing surface (e.g., PostScript) and any Fl_Offscreen argument (e.g., returned by Fl_image_Surface::offscreen()). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12148 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/drivers/GDI') diff --git a/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx b/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx index 54a4a038f..933593e6d 100644 --- a/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx @@ -34,7 +34,7 @@ public: Window pre_window; HDC _sgc; int _savedc; - Fl_GDI_Image_Surface_Driver(int w, int h, int high_res); + Fl_GDI_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off); ~Fl_GDI_Image_Surface_Driver(); void set_current(); void translate(int x, int y); @@ -45,13 +45,13 @@ public: Fl_Image_Surface_Driver *Fl_Image_Surface_Driver::newImageSurfaceDriver(int w, int h, int high_res, Fl_Offscreen off) { - return new Fl_GDI_Image_Surface_Driver(w, h, high_res); + return new Fl_GDI_Image_Surface_Driver(w, h, high_res, off); } -Fl_GDI_Image_Surface_Driver::Fl_GDI_Image_Surface_Driver(int w, int h, int high_res) : Fl_Image_Surface_Driver(w, h, high_res, 0) { +Fl_GDI_Image_Surface_Driver::Fl_GDI_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off) : Fl_Image_Surface_Driver(w, h, high_res, 0) { previous = 0; - offscreen = CreateCompatibleBitmap( (fl_graphics_driver->gc() ? (HDC)fl_graphics_driver->gc() : fl_GetDC(0) ) , w, h); + offscreen = off ? off : CreateCompatibleBitmap( (fl_graphics_driver->gc() ? (HDC)fl_graphics_driver->gc() : fl_GetDC(0) ) , w, h); driver(new Fl_Translated_GDI_Graphics_Driver); _sgc = NULL; } -- cgit v1.2.3