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);
}