vnc.capture

Asked by David ENJOLRAS on 2017-06-13

Using 1.1.1 build 2017-06-04

2 Strange issues :

vnc = vncStart("atemqesxhost21p", 5900)
ApplyKeyboardButton = vnc.wait("ApplyKeyboard.png")
test = Region(100,100,600,310)
img = vnc.capture(test)

1) ==> If I comment the "vnc.wait" line, then the capture is a black image

2) ==> With the vnc.wait, I have an image, but such resulting image is a strech from the supposed image 500*210 is extended to 600*310
( I mean that result have size 600*310, but the content is a stretch of the portion of screen asked ( 500x210 ) )

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2017-06-13
Last reply:
2017-06-30
RaiMan (raimund-hocke) said : #1

Could you please give more information about the VNC server system and what software is running.

The VNC server is an VMWARE ESX server 6.0.0

https://pubs.vmware.com/workstation-9/index.jsp?topic=%2Fcom.vmware.ws.using.doc%2FGUID-FB23927B-98A0-45E9-BFAC-85152F14BCAC.html

This allow me to manipulate the VM ( revert, boot on iso image, ... )

Capture of the whole screen works well. ( after a 1rst wait )

Launchpad Janitor (janitor) said : #3

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

RaiMan (raimund-hocke) said : #4

not solved

Hello,
I'm trying to debug this issue, but have question about accesing the sources.
Seems the VNC part is now in the SikuliX-2014 sources, but in a sikulix2tigervnc-2.0.0-20170517.105900-14.jar
Where can I get the sources of such sikulix2tigervnc ?

RaiMan (raimund-hocke) said : #6

Yes the sources are in
https://github.com/RaiMan/SikuliX-2014 (use branch develop)

in module sikulixapi (folder API)
org.sikuli.vnc

the relevant classes are VNCRobot and VNCScreen

the jar
sikulix2tigervnc-2.0.0-20170517

is not relevant - it contains the tigervnc java package as it is available in the net, but built in a form suitable for the SikuliX projects.
The sources are available in
https://github.com/RaiMan/Sikulix2tigervnc

... but should not be changed anyways.

Found the issues :

1) ==> If I comment the "vnc.wait" line, then the capture is a black image
We indeed need a small wait, a simple sleep(1) after vncstart if engouth to get ride of this issue

2) ==> With the vnc.wait, I have an image, but such resulting image is a strech from the supposed image.
Bug is in

VNCFrameBuffer::getImage
I've replace the old code by
i = image.getSubimage(x, y, w, h);
and this is now working well.

==> Could you validate/commit this modification ?

Can you help with this problem?

Provide an answer of your own, or ask David ENJOLRAS for more information if necessary.

To post a message you must log in.