Step-by-step execution:
- Closing all active programs
- Capturing the Dota 2 for 5 seconds (Size Dota 2 window (16x9, 1176x664)
- Transition to pyarm and execution of the code
Code:
import time
import cv2
import mss
import numpy
def screen_record_efficiency():
# game window
mon = {"top": 0, "left": 0, "width": 800, "height": 600}
title = "Dota [FPS]"
fps = 0
sct = mss.mss()
last_time = time.time()
while True:
img = numpy.asarray(sct.grab(mon))
fps += 1
cv2.imshow(title, img)
if cv2.waitKey(25) & 0xFF == ord("q"):
cv2.destroyAllWindows()
break
return fps
screen_record_efficiency()
When the code is launched, does not give any errors, does not show the grabbed dota 2 window