Exemple #1
0
        public Bitmap showCaptureArea(Size s, Bitmap b, int mode)
        {
            //if (Properties.Settings.Default.s_hasDelay) { /*TODO: Add delay */ }
            f_Canvas fc = new f_Canvas
            {
                bounds = s,
                bmp    = b,
                mode   = mode,
                save_editable_backup = canSaveEditImages && EditableMode
            };

            fc.ShowDialog();

            if (canSaveEditImages && EditableMode)
            {
                lastCutoutId = fc.randID;
            }

            return(fc.retImg);
        }
Exemple #2
0
        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 f_Canvas()
                {
                    bounds = new Size(100, 100), bmp = new Bitmap(1, 1)
                })
                {
                    if (snipper.ShowDialog() == DialogResult.OK)
                    {
                        return(snipper.Image);
                    }
                }
                return(null);
            }
        }