summaryrefslogtreecommitdiff
path: root/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-06-18 16:01:53 +0000
committerManolo Gouy <Manolo>2017-06-18 16:01:53 +0000
commit701fa00c7c54a1260f05ef41ee11592059d9f652 (patch)
treee256811b8842ac1376e8b3730c42478162849eb0 /src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx
parent2cda5a4fa682372f294a7a8e9e2b90a9fdb15610 (diff)
Advancing HiDPI support for the WIN32 platform - still incomplete.
It's still necessary to compile with -DFLTK_HIDPI_SUPPORT to activate the new HiDPI support. Default builds get the same HiDPI support as in FLTK 1.3 git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12265 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx')
-rw-r--r--src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx b/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx
index e55e69583..904511fe0 100644
--- a/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx
@@ -21,6 +21,7 @@
#ifdef FL_CFG_GFX_GDI
#include "Fl_GDI_Graphics_Driver.H"
+#include "../WinAPI/Fl_WinAPI_Screen_Driver.H"
#include <FL/Fl_Image_Surface.H>
#include <FL/fl_draw.H>
#include <FL/x.H>
@@ -55,7 +56,9 @@ Fl_GDI_Image_Surface_Driver::Fl_GDI_Image_Surface_Driver(int w, int h, int high_
w = int(w*d);
h = int(h*d);
}
- offscreen = off ? off : CreateCompatibleBitmap( (fl_graphics_driver->gc() ? (HDC)fl_graphics_driver->gc() : fl_GetDC(0) ) , w, h);
+ HDC gc = (HDC)Fl_Graphics_Driver::default_driver().gc();
+ offscreen = off ? off : CreateCompatibleBitmap( (gc ? gc : fl_GetDC(0) ) , w, h);
+ if (!offscreen) offscreen = CreateCompatibleBitmap(fl_GetDC(0), w, h);
driver(new Fl_GDI_Graphics_Driver);
if (d != 1 && high_res) driver()->scale(d);
_sgc = NULL;
@@ -93,11 +96,8 @@ void Fl_GDI_Image_Surface_Driver::untranslate() {
Fl_RGB_Image* Fl_GDI_Image_Surface_Driver::image()
{
- unsigned char *data;
- data = fl_read_image(NULL, 0, 0, width, height, 0);
+ Fl_RGB_Image *image = Fl::screen_driver()->read_win_rectangle(NULL, 0, 0, width, height, 0);
previous->driver()->gc(_sgc);
- Fl_RGB_Image *image = new Fl_RGB_Image(data, width, height);
- image->alloc_array = 1;
return image;
}