This commit is contained in:
恍兮惚兮 2024-05-29 13:23:41 +08:00
parent 0e38c1d31f
commit 6d88c762ac

View File

@ -233,10 +233,9 @@ def mouseselectwindow(callback):
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))
_r = QApplication.instance().devicePixelRatio()
_dpi = windows.GetDpiForWindow(hwnd)
x1, y1, x2, y2 = (int(_ * 96 / _dpi / _r) for _ in (x1, y1, x2, y2))
bs = winsharedutils.gdi_screenshot(x1, y1, x2, y2, hwnd)
pixmap = QPixmap()
if bs: