How do I set settings VNC?

Asked by Chp on 2017-05-16

Hello! Sorry for my English.

I use VNC Server for android Devices.
I use client Vnc TigerVnc Viewer and TightVnc Viewer
also i started to use Sikuli VncScreen()

My code:
------------------------
encodingHextile = 5
sVnc = vncStart('111.222.333.444', 5901)

client = sVnc.getClient()
client.writer().writeSetEncodings(encodingHextile, True)
# client.cp.setPF(PixelFormat(32, 32, True, True, 7, 7, 3, 0, 3, 6))
client.cp.pf().bigEndian = True
sleep(5)

sVnc.capture().save(Config.LOG_DIR)
-----------------------

and it's all right except for some things:

1. You use in your code this.currentEncoding = 7:
private VNCClient(String address, int port, String password, boolean shareConnection) throws IOException {
        this.security = new ThreadLocalSecurityClient(new BasicUserPasswdGetter(password));
        this.currentEncoding = 7;
        this.setShared(shareConnection);
        this.setServerName(address);
        this.setServerPort(port);
        this.sock = new TcpSocket(this.getServerName(), this.getServerPort());
        this.sock.inStream().setBlockCallback(this);
        this.setStreams(this.sock.inStream(), this.sock.outStream());
        this.initialiseProtocol();
    }

I can not capture a screen with this.currentEncoding = 7, I need this.currentEncoding = 5 (Hextile),
I have image, but it is damaged((((
so I have a question:
How can I set settings VNC?

2. How do VNCscreen set as default screen?

3. Image is damaged, even with this.currentEncoding = 5 (Hextile), sometimes, Do you know reason?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2017-05-17
Last query:
2017-05-17
Last reply:
2017-05-16
RaiMan (raimund-hocke) said : #1

I am myself currently trying to move the VNC solution to the latest TigerVNC software level.

Until completed the next days, I cannot help you in your situation.

Chp (chpnick) said : #2

ok
please ask question:
 How do VNCscreen set as default screen?

thank you

Best RaiMan (raimund-hocke) said : #3

try
useVnc(...)

instead of
vncStart(...)

with the same parameters.

Chp (chpnick) said : #4

Thanks RaiMan, that solved my question.