from ctypes import*
import os,time
import pyautogui as pag
import win32con
import win32gui
from PIL import ImageGrab
#----------------------------

hwnd = win32gui.FindWindow(32770,"大家来找茬")
if not hwnd:
print(RED,'window not found!',DEFAULT)
else:
print(hwnd)

win32gui.ShowWindow(hwnd,win32con.SW_RESTORE) #强行显示界面
win32gui.SetForegroundWindow(hwnd) #将窗口提到最前
#截屏
game_rect = win32gui.GetWindowRect(hwnd) #获取句柄矩形
src_image = ImageGrab.grab(game_rect)
src_image = ImageGrab.grab((game_rect[0]+116,game_rect[1]+390,game_rect[2]-117,game_rect[1]+747)) #截图句柄矩形
width,hight = src_image.size
left_box = (0,0,476,hight)
right_box = (571,0,width,hight)
image_left = src_image.crop(left_box)
image_right = src_image.crop(right_box)


image_left.show()
image_right.show()
print(width,hight)

#src_image.show()
#之后再修改,继续研究

更多相关文章

  1. 字体图标的引入和通过媒体查询改变导航样式
  2. HTML样式和常用选择器
  3. 字体图标的引用和自定义样式/媒体查询的使用
  4. 数据库的CURD操作、PDO本质与原理的学习
  5. CSS之伪类选择器和简单盒子简单案例
  6. 伪类选择器与盒模型常用属性
  7. 伪类选择器-结构伪类、根据位置选择匹配
  8. 7.4——常用标签与应用场景之表格与单元格
  9. css伪类选择器和盒模型

随机推荐

  1. 使用pip安装tensorflow 0.80,python 使用t
  2. 显示一个矩阵,将一个共同因素放在同情中
  3. python通过get方式,post方式发送http请求
  4. 不同程序语言之间的互动,IronPython 与C#
  5. Python语言特性之1:函数参数传递
  6. [置顶] Python + C/C++ 嵌入式编
  7. 零基础Python教程:如何实现PCA算法
  8. 解除装饰器作用(python3新增)
  9. django模板引擎有错误检查?
  10. Python定义函数时,不同参数类型的传递