private void Timer_Tick(object sender, EventArgs e) { if (bmpCaptured != null) { bmpCaptured.Dispose(); bmpCaptured = null; } if (bmpCapturedExapnd != null) { bmpCapturedExapnd.Dispose(); bmpCapturedExapnd = null; } bmpCaptured = ColorOnMouse.CaptureImage(MousePosition.X, MousePosition.Y); bmpCapturedExapnd = new Bitmap(bmpCaptured, new Size(bmpCaptured.Width * 8, bmpCaptured.Height * 8)); colorPicked = ColorOnMouse.GetColor(); picImage.Invalidate(); picExpand.Invalidate(); picColor.Invalidate(); }