void CaptureTimer_Tick(object sender, EventArgs e)
{
CaptureTimer.Stop();
Bitmap bitmapImage = new Bitmap((int)this.ActualWidth, (int)this.ActualHeight);
Graphics gr1 = Graphics.FromImage(bitmapImage);
IntPtr dc1 = gr1.GetHdc();
IntPtr dc2 = NativeMethods.GetWindowDC(NativeMethods.GetForegroundWindow());
NativeMethods.BitBlt(dc1, (int)20, (int)20, (int)this.ActualWidth, (int)this.ActualHeight, dc2, 20, 20, 13369376);
gr1.ReleaseHdc(dc1);
Random rnd = new Random();
bitmapImage.Save(string.Format(".\\Captures\\Capture{0}.jpg", rnd.Next().ToString()), ImageFormat.Jpeg);
PlaySoundOnButton(ButtonTypes.CaptureBtn);
CommandManager.InvalidateRequerySuggested();
}