Skip to content

Commit

Permalink
[Bugfix] Fixed ScreenGrab() bug
Browse files Browse the repository at this point in the history
The code assumed that the virtual screen coordinates were 0 causing bugged screenshots on some multiple monitor setups, fixed to be fetched dinamically.
  • Loading branch information
brat-volk authored Sep 17, 2022
1 parent 8785ecb commit 50a491c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MagikIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ void TakeScreenShot(const char* filename) {
HDC hDC = CreateCompatibleDC(hScreen);
HBITMAP hBitmap = CreateCompatibleBitmap(hScreen, w, h);
HGDIOBJ old_obj = SelectObject(hDC, hBitmap);
BOOL bRet = BitBlt(hDC, 0, 0, w, h, hScreen, x1, y1, SRCCOPY);
BOOL bRet = BitBlt(hDC, x1, y1, w, h, hScreen, x1, y1, SRCCOPY);

//include mouse pointer inside the screenshot(if it is displayed)
HWND hwnd = GetDesktopWindow();
Expand Down

0 comments on commit 50a491c

Please sign in to comment.