summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2018-04-29 07:35:06 +0000
committerManolo Gouy <Manolo>2018-04-29 07:35:06 +0000
commitba4559701f45b06eed6632442b340c98ff8038bb (patch)
tree456914cc68a41ae05328720bcfd368ea3216eb74 /src
parent929efec8555ef27b5bbe8c6f8b0948eade02792a (diff)
Fix Fl_WinAPI_System_Driver::paste() when the clipboard contains an image as a DIB and for GUI scale support.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12877 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_win32.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 59f8f7526..d012b57b5 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -511,7 +511,7 @@ int Fl_WinAPI_Screen_Driver::ready() {
return get_wsock_mod() ? s_wsock_select(0, &fdt[0], &fdt[1], &fdt[2], &t) : 0;
}
-// extern FILE *LOG;
+//FILE *LOG=fopen("log.log","w");
void Fl_WinAPI_Screen_Driver::open_display_platform() {
static char beenHereDoneThat = 0;
@@ -827,13 +827,15 @@ void Fl_WinAPI_System_Driver::paste(Fl_Widget &receiver, int clipboard, const ch
pDIBBits = (void *)(lpBI->bmiColors + 3);
else if (lpBI->bmiHeader.biClrUsed > 0)
pDIBBits = (void *)(lpBI->bmiColors + lpBI->bmiHeader.biClrUsed);
- Fl_Offscreen off = fl_create_offscreen(width, height);
- fl_begin_offscreen(off);
+ Fl_Image_Surface *surf = new Fl_Image_Surface(width, height);
+//fprintf(LOG,"complex DIB surf=%p biCompression=%d BI_BITFIELDS=%d biClrUsed=%d\n",
+// surf,lpBI->bmiHeader.biCompression,BI_BITFIELDS,lpBI->bmiHeader.biClrUsed);fflush(LOG);
+ Fl_Surface_Device::push_current(surf);
SetDIBitsToDevice((HDC)fl_graphics_driver->gc(), 0, 0, width, height, 0, 0, 0, height, pDIBBits, lpBI, DIB_RGB_COLORS);
rgb = fl_read_image(NULL, 0, 0, width, height);
depth = 3;
- fl_end_offscreen();
- fl_delete_offscreen(off);
+ Fl_Surface_Device::pop_current();
+ delete surf;
}
GlobalUnlock(h);
} else if ((h = GetClipboardData(CF_ENHMETAFILE))) { // if there's an enhanced metafile in clipboard
@@ -867,7 +869,7 @@ void Fl_WinAPI_System_Driver::paste(Fl_Widget &receiver, int clipboard, const ch
}
if (rgb || image) {
if (!image) {
- Fl_RGB_Image *image = new Fl_RGB_Image(rgb, width, height, depth); // create new image from pixel data
+ image = new Fl_RGB_Image(rgb, width, height, depth); // create new image from pixel data
image->alloc_array = 1;
}
Fl::e_clipboard_data = image;