def spec_printscreen():
# identify the top-right corner, doesnt find it!!
# ===========================================================================
# region_topright = pyautogui.locateOnScreen('topright.png')#,grayscale=True)
# if region_topright is None:
# print('Could not find topright picture')
# else:
# print(region_topright)
# ===========================================================================
# identify thedownleft corner from home button
region_downleft = pyautogui.locateOnScreen('downleft.png')
if region_downleft is None:
print('Could not find downleft picture')
else:
# print(region_downleft)
pass
fig = plt.gcf()
size = fig.get_size_inches() * fig.dpi # size in pixels
# print(size)
# im=pyautogui.screenshot(region=(0,0, 300, 400))
pyautogui.screenshot()
im2 = pyautogui.screenshot('latest_screenshot.png',
region=(region_downleft[0], region_downleft[1] - size[1], size[0], size[1]))
ctypes.windll.user32.MessageBoxA(0, "spec print screenshot finished, find it in latest_screenshot.png",
"Screenshot of the plot area", 0)
评论列表
文章目录