[1.1.0] screen.capture only Screen(0) in multi-monitor

Bug #1384494 reported by Tak Eda on 2014-10-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

************ this works with version 1.1.0

scrs = []
dir = getBundlePath()
for n in range(getNumberScreens()):
  scrs.append(Screen(n).getScreen()) # to get the Java level object
for scr in scrs:
  filename = "screen%d" % scr.getID()
  scr.capture().getFile(dir, filename)

captures of the screens are saved to the bundle as screenN.png

Sikuli version: 1.1.0-Beta2

I want to capture each screen separately every 2 seconds and wrote the following code to achieve it:

import os
import shutil

import datetime

screenshotsDir = r"C:\Users\Sikuli\Temp\Exceptions"

screens = [Screen(id) for id in range(Screen().getNumberScreens())]

print screens # Prints [S(0)[0,0 1920x1080] E:Y, T:3.0, S(1)[-1920,0 1920x1080] E:Y, T:3.0]
print Screen().getNumberScreens() # Prints 2

while True:
    for _dx, screen in enumerate(screens):
        print screen.getBounds() # Prints java.awt.Rectangle[x=0,y=0,width=1920,height=1080] and java.awt.Rectangle[x=-1920,y=0,width=1920,height=1080] respectively

        img = screen.capture(screen.getBounds())
        time_now = datetime.datetime.now().strftime("%H%M%S")
        img_target = "{}.S{}.png".format(time_now, _dx)

        target = os.path.join(screenshotsDir, img_target)
        shutil.move(img, target)


Unfortunately, when I go and check the screenshots, I see that Sikuli only grabbed S(0) for both monitors although the code print output gives all the right information!

RaiMan (raimund-hocke) wrote :

upgrade to the latest 1.1.0 pre-final and try again.

summary: - screen.capture capturing only Screen(0) even when multiple screens are
- present
+ [1.1.0 Beta] screen.capture only Screen(0) in multi-monitor

Hello, I faced the same issue on both these builds:


Did I use the right 1.1.0 pre-final build you asked me to use?

RaiMan (raimund-hocke) wrote :

you made it right ;-)

I have to check.

Changed in sikuli:
status: New → In Progress
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
RaiMan (raimund-hocke) on 2015-03-23
summary: - [1.1.0 Beta] screen.capture only Screen(0) in multi-monitor
+ [1.1.0] screen.capture only Screen(0) in multi-monitor
Changed in sikuli:
status: In Progress → Fix Committed
importance: High → Critical
RaiMan (raimund-hocke) on 2015-03-23
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers