Public bug reported:

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!

** Affects: sikuli
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1384494

Title:
  screen.capture capturing only Screen(0) even when multiple screens are
  present

Status in Sikuli:
  New

Bug description:
  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!

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1384494/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to