private static Bitmap cropFromScreen() { Image img = SnippingForm.Snip(); if (img != null) { return(new Bitmap(img)); } return(null); }
public static Image Snip() { var rc = Screen.PrimaryScreen.Bounds; using (Bitmap bmp = new Bitmap(rc.Width, rc.Height, System.Drawing.Imaging.PixelFormat.Format32bppPArgb)) { using (Graphics gr = Graphics.FromImage(bmp)) gr.CopyFromScreen(0, 0, 0, 0, bmp.Size); using (var snipper = new SnippingForm(bmp)) { snipper.BringToFront(); if (snipper.ShowDialog() == DialogResult.OK) { return(snipper.Image); } } return(null); } }