← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #290731]: VNCScreen in Java work fine. HowTo in python ?

 

Question #290731 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/290731

    Status: Answered => Open

David ENJOLRAS is still having a problem:
Good start point, but not working :-(
even with just the import lines :

[error] Did not find any active ConnectionControllers.  Cannot use
VNCScreen without a ConnectionController instance.
[error] ***** Terminating SikuliX after a fatal error 999 *****

On Tue, Apr 12, 2016 at 8:17 PM, Karl <question290731@xxxxxxxxxxxxxxxxxxxxx>
wrote:

> Your question #290731 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/290731
>
>     Status: Open => Answered
>
> Karl proposed the following answer:
> Imports are the most important thing.
>
> ----
>
> import java.net.Socket as Socket
> import edu.unh.iol.dlc.VNCScreen as VNCScreen
> import edu.unh.iol.dlc.ConnectionController as ConnectionController
>
> print("Start!\n");
> s = Socket("frlesvmhostqa02", 9101); #open a socket to vnc server on
> listening port
> s.setSoTimeout(1000);
> s.setKeepAlive(true); #some socket configuration
>
> cc = ConnectionController(s);
> cc.openConnection(0); #opens the vnc connection for connection 0, multiple
> are supported
> cc.setPixelFormat(0, "Truecolor", 32, 0); #for connection 0, set pixel
> data to Truecolor, 32 bits per pixel, little endian
> cc.start(0); #start thread that keeps BufferedImage updated by polling
> server for remote desktop changes
>
> wait(2); #wait for buffered image to be updated before we do sikuli
> stuff
>
> vnc = VNCScreen(); #default constructor uses ConnectionController index 0
> print("Avant Capture\n");
>
> Test = vnc.capture();
> Test.save("c:\\temp","test.png");
> print("Fin\n");
>
> --
> 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/290731/+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/290731
>
> You received this question notification because you asked the question.
>

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.