PLOT_backup_functions.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:polo_robot 作者: kmarci9 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号