Beispiel #1
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.SendMessage(new SetEncodingsMessage(new RfbEncodingType[] {
                RfbEncodingType.ZRLE,
                RfbEncodingType.Hextile,
                //RfbProtocol.CORRE_ENCODING, // CoRRE is buggy in some hosts, so don't bother using
                RfbEncodingType.RRE,
                RfbEncodingType.CopyRect,
                RfbEncodingType.Raw
            }));

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