public Form1() { StartPosition = FormStartPosition.CenterScreen; Width = screenCaptureArea.Width; Height = screenCaptureArea.Height; pictureBox = new PictureBox { Image = ScreenCaptureHelper.CaptureScreenArea(screenCaptureArea), Width = screenCaptureArea.Width, Height = screenCaptureArea.Height }; this.Controls.Add(pictureBox); var timer = new Timer { Interval = 30 }; timer.Tick += TimerOnTick; timer.Start(); }
private void TimerOnTick(object sender, EventArgs eventArgs) { pictureBox.Image = ScreenCaptureHelper.CaptureScreenArea(screenCaptureArea); GC.Collect(); }