/// <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);
        }
示例#2
0
        /// <summary>
        /// Finish setting-up protocol with VNC Host.  Should be called after Connect and Authenticate (if password required).
        /// </summary>
        public void Initialize(int bitsPerPixel, int depth)
        {
            // Finish initializing protocol with host
            rfb.WriteClientInitialisation(true);              // Allow the desktop to be shared
            Framebuffer = rfb.ReadServerInit(bitsPerPixel, depth);

            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 });

            rfb.WriteSetPixelFormat(Framebuffer);               // set the required ramebuffer format

            // Create an EncodedRectangleFactory so that EncodedRectangles can be built according to set pixel layout
            factory = new EncodedRectangleFactory(rfb, Framebuffer);
        }