Skip to content

Releases: AI-M-BOT/DXcam

Version 1.2 - Minor fixes and integrate updates from https://github.com/Agade09/DXcam

09 Aug 15:07
Compare
Choose a tag to compare

Packing

Copy init.py from dxcam package to your working path, rename it to whatever you prefer

In my case, i named it to pydxshot.py

Install nuitka by using command pip install nuitka
Go to your working path, run python -m nuitka --mingw64 --module --show-progress --no-pyi-file --remove-output --follow-import-to=dxcam dxshot.py

Possible fixes when you meet errors

Version 1.1 - Optimized speed for both partial screenshot and full screenshot !!!

26 Apr 03:47
a0964dc
Compare
Choose a tag to compare

Compiled version of dxcam for Python 3.7/3.8/3.9/3.10/3.11

  • There should be obviously a progress in both speed and resource usage
  • If you drag the cmd window to the middle of screen and take partial screenshot at that area you should feel it
  • In the example usage, print(time.perf_counter()-start) will lower down fps a bit but it does refresh the screen

Usage is simple, replace all dxcam with dxshot, enjoy 😁

import time
import dxshot
import cv2


shape = 640
left, top = (1920 - shape) // 2, (1080 - shape) // 2
right, bottom = left + shape, top + shape
region = (left, top, right, bottom)
title = "[DXcam] FPS benchmark"
cam = dxshot.create()
start_time = time.perf_counter()

fps = 0


while fps < 1000:
    start = time.perf_counter()
    frame = cam.grab(region=region)
    if frame is not None:
        print(time.perf_counter()-start)
        # start = now_time
        fps += 1
        # cv2.imshow('', frame)
        # cv2.waitKey(1)

end_time = time.perf_counter() - start_time

print(f"{title}: {fps/end_time}")
del cam
  • 20230429 fix

Version 1.0 - Faster DXcam !!!

31 Mar 18:45
fc0a257
Compare
Choose a tag to compare

Compiled version of dxcam for Python 3.7/3.8/3.9/3.10
Usage is simple, replace all dxcam with dxshot, enjoy 😁

import time
import dxshot
import cv2


shape = 640
left, top = (1920 - shape) // 2, (1080 - shape) // 2
right, bottom = left + shape, top + shape
region = (left, top, right, bottom)
title = "[DXcam] FPS benchmark"
cam = dxshot.create()
start_time = time.perf_counter()

fps = 0


while fps < 1000:
    start = time.perf_counter()
    frame = cam.grab(region=region)
    if frame is not None:
        # now_time = time.perf_counter()
        # print(now_time-start)
        # start = now_time
        fps += 1
        # cv2.imshow('', frame)
        # cv2.waitKey(1)

end_time = time.perf_counter() - start_time

print(f"{title}: {fps/end_time}")
del cam