public static bool Snip()
        {
            FindMultiScreenSize();
            Bitmap bmp = null;

            try
            {
                bmp = new Bitmap(snipBounds.MaxRight - snipBounds.MinX, snipBounds.MaxBottom - snipBounds.MinY, System.Drawing.Imaging.PixelFormat.Format32bppPArgb);
            }
            catch (Exception e)
            {
            }

            Graphics gr = Graphics.FromImage(bmp);

            Graph            = gr;
            gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
            BitmapSize       = bmp.Size;


            using (var snipper = new SnippingTool(bmp))
            {
                snipper.Location = new Point(snipBounds.MinX, snipBounds.MinY);

                if (snipper.ShowDialog() == DialogResult.OK)
                {
                    ScreenshotHelper.SaveScreenshotToCache(snipper.Image);
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 2
0
 public void GetCurrentViewportScreenshot()
 {
     ScreenshotHelper.SaveScreenshotToCache(GetCurrentViewScreenshot());
     FireScreenshotCompleteEvent(true);
 }