首页/下载资源/音视频/python调用DXGI实时快速截屏,是python截屏的最快版了

ZIPpython调用DXGI实时快速截屏,是python截屏的最快版了

exploretheunkown61.17MB需要积分:1

资源文件列表:

pythonDXGI截屏.zip 大约有18个文件
  1. pythonDXGI截屏/.idea/
  2. pythonDXGI截屏/.idea/.gitignore 50B
  3. pythonDXGI截屏/.idea/inspectionProfiles/
  4. pythonDXGI截屏/.idea/inspectionProfiles/profiles_settings.xml 174B
  5. pythonDXGI截屏/.idea/inspectionProfiles/Project_Default.xml 1.55KB
  6. pythonDXGI截屏/.idea/misc.xml 203B
  7. pythonDXGI截屏/.idea/modules.xml 291B
  8. pythonDXGI截屏/.idea/pythonDXGI截屏.iml 339B
  9. pythonDXGI截屏/.idea/workspace.xml 4.09KB
  10. pythonDXGI截屏/cut.py 716B
  11. pythonDXGI截屏/DXGI.pyd 117KB
  12. pythonDXGI截屏/opencv_world3416.dll 53.23MB
  13. pythonDXGI截屏/opencv_world451.dll 58.74MB
  14. pythonDXGI截屏/py3.8/
  15. pythonDXGI截屏/py3.8/DXGI.pyd 117KB
  16. pythonDXGI截屏/py3.8/opencv_world3416.dll 53.23MB
  17. pythonDXGI截屏/py3.9/
  18. pythonDXGI截屏/py3.9/DXGI.pyd 117KB

资源介绍:

是python截屏的最快版了大概2ms左右,可以用在游戏实时截屏中FPS上百没啥问题
import os import time os.getcwd() os.add_dll_directory('H:\pythonDXGI截屏\DXGI.pyd') from ctypes import windll import cv2 import numpy as np windll.winmm.timeBeginPeriod(1) stop = windll.kernel32.Sleep import cv2 # 把DXGI.pyd 复制到当前路径 import DXGI import torch g = DXGI.capture(0, 0, 320, 320) # 屏幕左上角 到 右下角 (x1, y1 ,x2 ,y2) while True: current_time = time.time() img = g.cap() img = np.array(img) # # 将图片转 BGR img = cv2.cvtColor(img, cv2.COLOR_BGRA2BGR) last_time=time.time() time_used = last_time - current_time print(time_used) current_time, last_time=0, 0 cv2.imshow('c',img) cv2.waitKey(1)
100+评论
captcha