ScreenToGif.Modern.timerCapWithCursor_Tick C# (CSharp) Method

timerCapWithCursor_Tick() private method

Takes a screenshot of desired area and add to the list, plus add to the list the position and icon of the cursor.
private timerCapWithCursor_Tick ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void timerCapWithCursor_Tick(object sender, EventArgs e)
        {
            _cursorInfo = new CursorInfo
            {
                IconImage = _capture.CaptureImageCursor(ref _posCursor),
                Position = panelTransparent.PointToClient(_posCursor),
                Clicked = _recordClicked,
            };

            //Get actual icon of the cursor
            _listCursor.Add(_cursorInfo);
            //Get the actual position of the form.
            Point lefttop = new Point(this.Location.X + panelTransparent.Location.X, this.Location.Y + panelTransparent.Location.Y);
            //Take a screenshot of the area.
            _gr.CopyFromScreen(lefttop.X, lefttop.Y, 0, 0, panelTransparent.Bounds.Size, CopyPixelOperation.SourceCopy);
            //Add the bitmap to a list

            _addDel.BeginInvoke(String.Format("{0}{1}.bmp", _pathTemp, _frameCount), new Bitmap(_bt), CallBack, null);

            this.Invoke((Action)(() => this.Text = String.Format("Screen To Gif • {0}", _frameCount)));

            _frameCount++;
            GC.Collect(1);
        }
Modern