pythonDXGI截屏.zip
大小:61.17MB
价格:31积分
下载量:0
评分:
5.0
上传者:exploretheunkown
更新日期:2025-09-22

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

资源文件列表(大概)

文件名
大小
pythonDXGI截屏/.idea/
-
pythonDXGI截屏/.idea/.gitignore
50B
pythonDXGI截屏/.idea/inspectionProfiles/
-
pythonDXGI截屏/.idea/inspectionProfiles/profiles_settings.xml
174B
pythonDXGI截屏/.idea/inspectionProfiles/Project_Default.xml
1.55KB
pythonDXGI截屏/.idea/misc.xml
203B
pythonDXGI截屏/.idea/modules.xml
291B
pythonDXGI截屏/.idea/pythonDXGI截屏.iml
339B
pythonDXGI截屏/.idea/workspace.xml
4.09KB
pythonDXGI截屏/cut.py
716B
pythonDXGI截屏/DXGI.pyd
117KB
pythonDXGI截屏/opencv_world3416.dll
53.23MB
pythonDXGI截屏/opencv_world451.dll
58.74MB
pythonDXGI截屏/py3.8/
-
pythonDXGI截屏/py3.8/DXGI.pyd
117KB
pythonDXGI截屏/py3.8/opencv_world3416.dll
53.23MB
pythonDXGI截屏/py3.9/
-
pythonDXGI截屏/py3.9/DXGI.pyd
117KB

资源内容介绍

是python截屏的最快版了大概2ms左右,可以用在游戏实时截屏中FPS上百没啥问题
import osimport timeos.getcwd()os.add_dll_directory('H:\pythonDXGI截屏\DXGI.pyd')from ctypes import windllimport cv2import numpy as npwindll.winmm.timeBeginPeriod(1)stop = windll.kernel32.Sleepimport cv2# 把DXGI.pyd 复制到当前路径import DXGIimport torchg = 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)

用户评论 (0)

发表评论

captcha