mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-01 10:04:12 +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):
|
def screenshot(x1, y1, x2, y2, hwnd=None):
|
||||||
if hwnd:
|
if hwnd:
|
||||||
rate = QApplication.instance().devicePixelRatio() / (
|
_r = QApplication.instance().devicePixelRatio()
|
||||||
windows.GetDpiForWindow(hwnd) / 96
|
_dpi = windows.GetDpiForWindow(hwnd)
|
||||||
)
|
x1, y1, x2, y2 = (int(_ * 96 / _dpi / _r) for _ in (x1, y1, x2, y2))
|
||||||
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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user