Update docs

This commit is contained in:
FredWuCZ
2024-10-22 20:42:27 +08:00
parent 82878c885c
commit e9dbc3c374
3 changed files with 39 additions and 5 deletions

View File

@@ -180,16 +180,19 @@ def capture_screen_with_cursor():
return (cursor, hotspot)
cursor, (hotspotx, hotspoty) = get_cursor()
ratio = ctypes.windll.shcore.GetScaleFactorForDevice(0) / 100
img = ImageGrab.grab(bbox=None, include_layered_windows=True)
pos_win = win32gui.GetCursorPos()
pos = (round(pos_win[0]*ratio - hotspotx), round(pos_win[1]*ratio - hotspoty))
try:
cursor, (hotspotx, hotspoty) = get_cursor()
img.paste(cursor, pos, cursor)
pos_win = win32gui.GetCursorPos()
pos = (round(pos_win[0]*ratio - hotspotx), round(pos_win[1]*ratio - hotspoty))
img.paste(cursor, pos, cursor)
except:
pass
img.save(file_path)
elif user_platform == "Linux":