Exemplo n.º 1
0
        private void btnSaveSnap_Click(object sender, EventArgs e)
        {
            if (!Directory.GetDirectories(Environment.CurrentDirectory).Contains("Screenshots"))
            {
                Directory.CreateDirectory(Environment.CurrentDirectory + "\\Screenshot");
            }
            var image = ProcessHelper.CaptureProcessWindow("Bluestacks", out var rect);

            if (image == null)
            {
                return;
            }
            image.Save(Environment.CurrentDirectory + "\\Screenshot\\" + DateTime.Now.ToString("yy-MM-dd_hh-mm-ss") + ".bmp");
        }
Exemplo n.º 2
0
        private void TimerOnTick(object sender, EventArgs e)
        {
            _timer.Stop();

            var image = ProcessHelper.CaptureProcessWindow("cmd", out var formRect);

            _overlay.Left   = formRect.left;
            _overlay.Top    = formRect.top;
            _overlay.Width  = formRect.right - formRect.left;
            _overlay.Height = formRect.bottom - formRect.top;

            var img = Image.FromFile("c:\\Dev\\KorotAl2\\git\\test.png");

            _overlay.Draw(img);
            _overlay.Show();

            pbScreenshot.Image    = image;
            pbScreenshot.SizeMode = PictureBoxSizeMode.Zoom;
            LoadImage(image);
            _timer.Start();
        }