经过几个小时的谷歌搜索,我终于“写出”了这个:
import win32gui
from ctypes import windll
hwnd = win32gui.FindWindow(None, 'Steam')
hdc = win32gui.GetDC(hwnd)
hdcMem = win32gui.CreateCompatibleDC(hdc)
hbitmap = win32ui.CreateBitmap()
hbitmap = win32gui.CreateCompatibleBitmap(hdcMem, 500, 500)
win32gui.SelectObject(hdcMem, hbitmap)
windll.user32.PrintWindow(hwnd, hdcMem, 0)
这是正确的方法吗?如何保存图像?
提前谢谢。
经过大量的搜索和尝试各种不同的方法,下面的工作为我。
相关问题 更多 >
编程相关推荐