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

Bug #1384494 reported by Tak Eda
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Committed
Critical
RaiMan

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)

    time.sleep(2)

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!

Revision history for this message
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
Revision history for this message
Tak Eda (takeda) wrote : Re: [1.1.0 Beta] screen.capture only Screen(0) in multi-monitor

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

http://imgur.com/a/nUvZK

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

Revision history for this message
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)
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)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.