Advertisement
Guest User

gimp screenshot plugin patch

a guest
Feb 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.94 KB | None | 0 0
  1.  plug-ins/screenshot/screenshot-win32.c | 20 +++++++-------------
  2.  1 file changed, 7 insertions(+), 13 deletions(-)
  3.  
  4. diff --git a/plug-ins/screenshot/screenshot-win32.c b/plug-ins/screenshot/screenshot-win32.c
  5. index 277f9a5..1545bac 100644
  6. --- a/plug-ins/screenshot/screenshot-win32.c
  7. +++ b/plug-ins/screenshot/screenshot-win32.c
  8. @@ -405,9 +405,11 @@ primDoWindowCapture (HDC  hdcWindow,
  9.    /* Copy the data from the application to the bitmap.  Even if we did
  10.     * round up the width, BitBlt only the actual data.
  11.     */
  12. -  if (!BitBlt(hdcCompat, 0,0,
  13. +  printf("left: %d top: %d right: %d bottom: %d width: %d height: %d\n", rect.left, rect.top, rect.right, rect.bottom, width, height);
  14. +
  15. +  if (!BitBlt(hdcCompat,0, 0,
  16.                width, height,
  17. -              hdcWindow, 0,0,
  18. +              hdcWindow, rect.left, rect.top,
  19.                SRCCOPY))
  20.      {
  21.        formatWindowsError (buffer, sizeof buffer);
  22. @@ -456,26 +458,18 @@ doCapture (HWND selectedHwnd)
  23.  
  24.        /* Build a region for the capture */
  25.        GetWindowRect (selectedHwnd, &rect);
  26. -      capRegion = CreateRectRgn (rect.left, rect.top,
  27. -                                 rect.right, rect.bottom);
  28. -      if (!capRegion)
  29. -        {
  30. -          formatWindowsError (buffer, sizeof buffer);
  31. -          g_error ("Error creating region: %s", buffer);
  32. -          return FALSE;
  33. -        }
  34.  
  35.        /* Get the device context for the selected
  36.         * window.  Create a memory DC to use for the
  37.         * Bit copy.
  38.         */
  39. -      hdcSrc = GetDCEx (selectedHwnd, capRegion,
  40. -                        DCX_WINDOW | DCX_PARENTCLIP | DCX_INTERSECTRGN);
  41. +      hdcSrc = CreateDC (TEXT("DISPLAY"), NULL, NULL, NULL);
  42. +
  43.      }
  44.    else
  45.      {
  46.        /* Get the device context for the whole screen */
  47. -      hdcSrc = CreateDC ("DISPLAY", NULL, NULL, NULL);
  48. +      hdcSrc = CreateDC (TEXT("DISPLAY"), NULL, NULL, NULL);
  49.  
  50.        /* Get the screen's rectangle */
  51.        rect.top = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement