From 7dba27a404d20485646ea57a526ec79a658ed9cb Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 29 Apr 2018 11:02:34 +0000 Subject: Fix Fl_WinAPI_System_Driver::paste() when clipboard contains GIF image git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12878 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_win32.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index d012b57b5..103bd5bc0 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -822,14 +822,12 @@ void Fl_WinAPI_System_Driver::paste(Fl_Widget &receiver, int clipboard, const ch } } } else { // the system will decode a complex DIB - void *pDIBBits = (void *)(lpBI->bmiColors); + void *pDIBBits = (void *)(lpBI->bmiColors + 256); if (lpBI->bmiHeader.biCompression == BI_BITFIELDS) pDIBBits = (void *)(lpBI->bmiColors + 3); else if (lpBI->bmiHeader.biClrUsed > 0) pDIBBits = (void *)(lpBI->bmiColors + lpBI->bmiHeader.biClrUsed); 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); -- cgit v1.2.3