issues/773

This commit is contained in:
恍兮惚兮 2024-05-29 13:19:50 +08:00
parent 9d5955ec58
commit 0e38c1d31f

View File

@ -232,6 +232,11 @@ def mouseselectwindow(callback):
def screenshot(x1, y1, x2, y2, hwnd=None): def screenshot(x1, y1, x2, y2, hwnd=None):
if hwnd:
rate = QApplication.instance().devicePixelRatio() / (
windows.GetDpiForWindow(hwnd) / 96
)
x1, y1, x2, y2 = (int(_ / rate) for _ in (x1, y1, x2, y2))
bs = winsharedutils.gdi_screenshot(x1, y1, x2, y2, hwnd) bs = winsharedutils.gdi_screenshot(x1, y1, x2, y2, hwnd)
pixmap = QPixmap() pixmap = QPixmap()
if bs: if bs: