Screen goes completely black during capture.

Asked by Brandon Darling

I have Sikuli installed on an HP laptop. When using the hotkey to invoke screen capture, the screen goes completely black. I am unable to see anything on the screen. Is there a solution to this?

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

do you have a monitor attached?
if yes: only the configuration where SCREEN (Screen(0)) is at (0,0) runs

You should use the .bat, to start Sikuli IDE.

Make a test: put the following into a .skl and run it from command line:
print capture("Do you see me?")

If the same happens, then something with your installation may be wrong or it is a bug.

Revision history for this message
Brandon Darling (brandon-orbistechnology) said :
#2

Yes, there is a monitor attached, hence the comment, the screen goes completely black during capture.

Where do I put this statement:

SCREEN (Screen(0)) is at (0,0)

I used the .bat inside the c:\program files\sikuli folder and there is no change.

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of RaiMan
Sent: Tuesday, September 28, 2010 01:52
To: <email address hidden>
Subject: Re: [Question #127102]: Screen goes completely black during capture.

Your question #127102 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/127102

    Status: Open => Answered

RaiMan proposed the following answer:
do you have a monitor attached?
if yes: only the configuration where SCREEN (Screen(0)) is at (0,0) runs

You should use the .bat, to start Sikuli IDE.

Make a test: put the following into a .skl and run it from command line:
print capture("Do you see me?")

If the same happens, then something with your installation may be wrong
or it is a bug.

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/127102/+confirm?answer_id=0

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/127102

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

I'm talking about a second external monitor to be clear now.

if this is the fact:
   look bug 606405 for explanations

   Try to use Sikuli on the laptop without having the external monitor attached.

else:
   make the .skl test mentioned above.

check your .bat wether it is the newest version (calling java instead of javaw), otherwise download from https://launchpad.net/sikuli/trunk.

if nothing helps: something with your installation may be wrong or it is a bug.

Revision history for this message
Brandon Darling (brandon-orbistechnology) said :
#4

Okay, the second monitor was the issue. Is there a pending fix in the works for this? Would this affect ALL dual monitor systems? All of our developer desktops are dual screen setups.

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of RaiMan
Sent: Tuesday, September 28, 2010 10:36
To: <email address hidden>
Subject: RE: [Question #127102]: Screen goes completely black during capture.

Your question #127102 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/127102

    Status: Open => Answered

RaiMan proposed the following answer:
I'm talking about a second external monitor to be clear now.

if this is the fact:
   look bug 606405 for explanations

   Try to use Sikuli on the laptop without having the external monitor
attached.

else:
   make the .skl test mentioned above.

check your .bat wether it is the newest version (calling java instead of
javaw), otherwise download from https://launchpad.net/sikuli/trunk.

if nothing helps: something with your installation may be wrong or it is
a bug.

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/127102/+confirm?answer_id=2

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/127102

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
RaiMan (raimund-hocke) said :
#5

fix? not really (look at the developer comments in the bug mentioned above)

If Sikuli IDE is running at all and you can enter and run the following script and post the output in the message area, may be I can tell you more.

setShowActions(True)
s0 = Screen(0).getBounds()
s1 = Screen(1).getBounds()
hover(Location(s0.x+100, s0.y+100)
print Env.getMouseLocation()
hover(Location(s1.x+100, s1.y+100)
print Env.getMouseLocation()

Revision history for this message
Brandon Darling (brandon-orbistechnology) said :
#6

Here's what we got when we ran that script:

[sikuli] Stopped
[sikuli] An error occurs at line 5
[sikuli] Error message:
SyntaxError: ("no viable alternative at input 'print'", ('C:\\DOCUME~1\\ADMINI~1\\LOCALS~1\\Temp\\sikuli-tmp5686424226400098583.py', 5, 0, 'print Env.getMouseLocation()\n'))

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of RaiMan
Sent: Tuesday, September 28, 2010 11:44
To: <email address hidden>
Subject: RE: [Question #127102]: Screen goes completely black during capture.

Your question #127102 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/127102

    Status: Open => Needs information

RaiMan requested for more information:
fix? not really (look at the developer comments in the bug mentioned
above)

If Sikuli IDE is running at all and you can enter and run the following
script and post the output in the message area, may be I can tell you
more.

setShowActions(True)
s0 = Screen(0).getBounds()
s1 = Screen(1).getBounds()
hover(Location(s0.x+100, s0.y+100)
print Env.getMouseLocation()
hover(Location(s1.x+100, s1.y+100)
print Env.getMouseLocation()

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/sikuli/+question/127102

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
RaiMan (raimund-hocke) said :
#7

Sorry, there is a closing bracket missing with the 2 statements: hover(Location(.....

so again:

setShowActions(True)
s0 = Screen(0).getBounds()
s1 = Screen(1).getBounds()
hover(Location(s0.x+100, s0.y+100))
print Env.getMouseLocation()
hover(Location(s1.x+100, s1.y+100))
print Env.getMouseLocation()

Revision history for this message
Brandon Darling (brandon-orbistechnology) said :
#8

Results from the new script. We *can* see the "crosshairs" appear on both screens and both screens DO NOT go black.

ScreenMatchProxy loaded.
VDictProxy loaded.
Win32Util loaded.
ScreenMatchProxy loaded.
[sikuli] showTarget 75 75 50 50
(100,100)
[sikuli] showTarget 1755 75 50 50
(1780,100)

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of RaiMan
Sent: Tuesday, September 28, 2010 19:00
To: <email address hidden>
Subject: RE: [Question #127102]: Screen goes completely black during capture.

Your question #127102 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/127102

RaiMan posted a new comment:
Sorry, there is a closing bracket missing with the 2 statements:
hover(Location(.....

so again:

setShowActions(True)
s0 = Screen(0).getBounds()
s1 = Screen(1).getBounds()
hover(Location(s0.x+100, s0.y+100))
print Env.getMouseLocation()
hover(Location(s1.x+100, s1.y+100))
print Env.getMouseLocation()

--
You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
RaiMan (raimund-hocke) said :
#9

if you are still interested: run the following script and paste the message area here.

if there are any problems with the script due to the copy and paste action, just download the script from https://files.me.com/rhocke/p4ofec , unzip it somewhere (you get a directory screentest.sikuli), open it in the IDE and run it.

setShowActions(True)
s0 = Screen(0).getBounds()
print s0
s1 = Screen(1).getBounds()
print s1
print "------ hover test s0"
popup("A crosshair will be displayed in upper left corner of Screen(0). Remember the monitor!")
hover(Location(s0.x+100, s0.y+100))
print Env.getMouseLocation()
print input("fill in the combination: left or right (monitor) and laptop or external (monitor)")
print input("fill in yes, if this monitor has the Windows taskbar, otherwise just klick ok")
print "------ hover test s1"
popup("A crosshair will be displayed in upper left corner of Screen(1). Remember the monitor!")
hover(Location(s1.x+100, s1.y+100))
print Env.getMouseLocation()
print input("fill in the combination: left or right (Monitor) and Laptop or External (Monitor)")
print input("fill in yes, if this monitor has the Windows taskbar, otherwise just klick ok")
print "------ capture test s0"
popup("now we try to capture the upper left corner (0,0,300,300) of Screen(0)")
img = capture(s0.x, s0.y, 300, 300)
print input("Now check the content of image file\n"+img+"\nand fill in black if this is the fact, otherwise click ok")
print "------ capture test s1"
popup("now we try to capture the upper left corner (0,0,300,300) of Screen(1)")
img = capture(s1.x, s1.y, 300, 300)
print input("Now check the content of image file\n"+img+"\nand fill in black if this is the fact, otherwise click ok")
print "------ selectRegion test s0"
popup("now you will try to select a region on Screen(0). \nIf the monitor turns black, move the mouse pointer to Screen(0) and just click right or left mouse button to cancel.\nclick OK to proceed")
r0 = selectRegion("select a Region on Screen(0)")
print r0
print Env.getMouseLocation()
if r0:
   print "------ selectRegion test s1"
   popup("now the same for Screen(1)")
   print selectRegion("select a Region on Screen(0)")
   print Env.getMouseLocation()
print "------ click test s0"
popup("after clicking OK, click somewhere in the middle of Screen(0) within 5 seconds and don't move the mouse afterwards")
wait(6)
print Env.getMouseLocation()
print "------ click test s1"
popup("after clicking OK, click somewhere in the middle of Screen(1) within 5 seconds and don't move the mouse afterwards")
wait(6)
print Env.getMouseLocation()
popup("This ends the test. The results are shown in the message area")

Revision history for this message
Brandon Darling (brandon-orbistechnology) said :
#10

Ran script. Results.

ScreenMatchProxy loaded.
VDictProxy loaded.
Win32Util loaded.
ScreenMatchProxy loaded.
java.awt.Rectangle[x=0,y=0,width=1680,height=1050]
java.awt.Rectangle[x=1680,y=0,width=1280,height=1024]
------ hover test s0
[sikuli] showTarget 75 75 50 50
(100,100)
left and laptop
yes
------ hover test s1
[sikuli] showTarget 1755 75 50 50
(1780,100)
right and external

------ capture test s0

------ capture test s1

------ selectRegion test s0
None
(827,551)
------ click test s0
(827,541)
------ click test s1
(2324,501)

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of RaiMan
Sent: Wednesday, September 29, 2010 03:57
To: <email address hidden>
Subject: RE: [Question #127102]: Screen goes completely black during capture.

Your question #127102 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/127102

    Status: Open => Needs information

RaiMan requested for more information:
if you are still interested: run the following script and paste the
message area here.

if there are any problems with the script due to the copy and paste
action, just download the script from https://files.me.com/rhocke/p4ofec
, unzip it somewhere (you get a directory screentest.sikuli), open it in
the IDE and run it.

setShowActions(True)
s0 = Screen(0).getBounds()
print s0
s1 = Screen(1).getBounds()
print s1
print "------ hover test s0"
popup("A crosshair will be displayed in upper left corner of Screen(0). Remember the monitor!")
hover(Location(s0.x+100, s0.y+100))
print Env.getMouseLocation()
print input("fill in the combination: left or right (monitor) and laptop or external (monitor)")
print input("fill in yes, if this monitor has the Windows taskbar, otherwise just klick ok")
print "------ hover test s1"
popup("A crosshair will be displayed in upper left corner of Screen(1). Remember the monitor!")
hover(Location(s1.x+100, s1.y+100))
print Env.getMouseLocation()
print input("fill in the combination: left or right (Monitor) and Laptop or External (Monitor)")
print input("fill in yes, if this monitor has the Windows taskbar, otherwise just klick ok")
print "------ capture test s0"
popup("now we try to capture the upper left corner (0,0,300,300) of Screen(0)")
img = capture(s0.x, s0.y, 300, 300)
print input("Now check the content of image file\n"+img+"\nand fill in black if this is the fact, otherwise click ok")
print "------ capture test s1"
popup("now we try to capture the upper left corner (0,0,300,300) of Screen(1)")
img = capture(s1.x, s1.y, 300, 300)
print input("Now check the content of image file\n"+img+"\nand fill in black if this is the fact, otherwise click ok")
print "------ selectRegion test s0"
popup("now you will try to select a region on Screen(0). \nIf the monitor turns black, move the mouse pointer to Screen(0) and just click right or left mouse button to cancel.\nclick OK to proceed")
r0 = selectRegion("select a Region on Screen(0)")
print r0
print Env.getMouseLocation()
if r0:
   print "------ selectRegion test s1"
   popup("now the same for Screen(1)")
   print selectRegion("select a Region on Screen(0)")
   print Env.getMouseLocation()
print "------ click test s0"
popup("after clicking OK, click somewhere in the middle of Screen(0) within 5 seconds and don't move the mouse afterwards")
wait(6)
print Env.getMouseLocation()
print "------ click test s1"
popup("after clicking OK, click somewhere in the middle of Screen(1) within 5 seconds and don't move the mouse afterwards")
wait(6)
print Env.getMouseLocation()
popup("This ends the test. The results are shown in the message area")

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/sikuli/+question/127102

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
RaiMan (raimund-hocke) said :
#11

OK.

- your monitor configuration is ok.
- the internal capturing seems to work (the images taken internally showed the correct content you said)
- mouse actions seem to work

The only ;-) problem really seems to be that the overlay window to support the interactive capturing feature does not work.

--- you have 3 choices:
1. leave Sikuli behind you
2. report a bug based on detailed information about your hardware/software configuration (little hope)
3. try Sikuli on one of your laptop's without an external monitor attached and configurated as a normal one-screen system (just to see wether it is a problem with your video equipment/drivers) and then go to 1.or 2. if the problem still exists

--- A last possibility: do you have any software (don't ask me what this could be ;-) running, that may conflict with the respective java features that are used in Sikuli to accomplish interactive capturing?

--- One more thing: depending on your planned usage, you could use Sikuli without the interactive capturing: Use any screen capture tool, that is able to produce .png files and load these files in the IDE using the "Load image file" button (above left middle - yellowish monitor symbol). this will copy the image files into your .sikuli.

All the best.

Revision history for this message
Launchpad Janitor (janitor) said :
#12

This question was expired because it remained in the 'Open' state without activity for the last 15 days.