예제 #1
0
 public void InitEdit()
 {
     testTheEdit = new Edit(testBitmap);
 }
예제 #2
0
        /*
         * Grabs a screenshot of the user's desktop
         */
        private void takeScreenshot()
        {
            try
            {
                // hide the current window
                this.Hide();
                this.SetSaveLocation();
                // give the window some time to sleep
                Thread.Sleep(200);
                bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
                gfxScreenshot = Graphics.FromImage(bmpScreenshot);
                gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
                bmpScreenshot.Save(SaveLocation, ImageFormat.Png);
                numSuffix++;

                // open image editing window
                EditScreen = new Edit(bmpScreenshot);
                EditScreen.Show();
                this.Close();

            }
            catch
            {
                // log the error somewhere
                // and inform the user about it
            }
        }