/// <summary> /// Finish setting-up protocol with VNC Host. Should be called after Connect and Authenticate (if password required). /// </summary> public void Initialize() { // Finish initializing protocol with host rfb.WriteClientInitialisation(false); buffer = rfb.ReadServerInit(); rfb.WriteSetPixelFormat(buffer); // just use the server's framebuffer format rfb.WriteSetEncodings(new uint[] { RfbProtocol.ZRLE_ENCODING, RfbProtocol.HEXTILE_ENCODING, // RfbProtocol.CORRE_ENCODING, // CoRRE is buggy in some hosts, so don't bother using RfbProtocol.RRE_ENCODING, RfbProtocol.COPYRECT_ENCODING, RfbProtocol.RAW_ENCODING }); // Create an EncodedRectangleFactory so that EncodedRectangles can be built according to set pixel layout factory = new EncodedRectangleFactory(rfb, buffer); }