示例#1
0
        /// <summary>
        /// Salva tela no buffer da sessão
        /// </summary>
        /// <returns></returns>
        public bool SetScreen(SessionClass oSession, Int64 oQuality, bool bGrayScale)
        {
            bool         bResult       = true;
            ImageWrapper oImageWrapper = null;

            Graphics oGraphics;
            int      iScreenWidth  = Screen.PrimaryScreen.Bounds.Width;
            int      iScreenHeight = Screen.PrimaryScreen.Bounds.Height;
            //armazena a imagem no bitmap
            Bitmap oBitmap = new Bitmap(iScreenWidth, iScreenHeight);

            //copia  a tela no bitmap
            oGraphics = Graphics.FromImage(oBitmap);
            oGraphics.CopyFromScreen(Point.Empty, Point.Empty, Screen.PrimaryScreen.Bounds.Size);
            //atribui a imagem ao picturebox exibindo-a
            oBitmap.SetResolution(72, 72);
            oImageWrapper = new ImageWrapper(oBitmap, oQuality, bGrayScale);

            oSession.SessionBuffer.Write(oImageWrapper.Bytes);

            return(bResult);
        }
示例#2
0
        /// <summary>
        /// Recupera tela do buffer da sessão
        /// </summary>
        /// <param name="oSession"></param>
        /// <returns></returns>
        public ImageWrapper GetScreen(SessionClass oSession)
        {
            ImageWrapper oImageWrapper = new ImageWrapper(oSession.SessionBuffer.Read());

            return(oImageWrapper);
        }