Answer the question
In order to leave comments, you need to log in
How to take a screenshot from two displays using python?
Good day!
Advise how you can take a screenshot from different external devices.
I have a display and a TV connected to my computer via hdmi, I found a lib for python
pyautogui on the network, I wrote a function that takes a screenshot, but it takes a screenshot from the main monitor
How to detect additional monitors? I didn't find any such items in the manual.
def print_screen(name):
image = pyautogui.screenshot(region=(0, 0, 1920, 1080))
image = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
cv2.imshow('Screenshot', imutils.resize(image, width=1200))
cv2.imwrite(name+'.png', image)
print(list(pyautogui.locateAllOnScreen(name+'.png')))
position = pyautogui.locateOnScreen('screen1.jpg')
print(position)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question