private void CaptureBitmap(Rectangle r) { bitmap = new Bitmap(r.Width, r.Height); using (Graphics g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(r.Location, new Point(0, 0), r.Size); } PasteImage(bitmap); }