mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
precise
This commit is contained in:
parent
0e38c1d31f
commit
6d88c762ac
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user