Beispiel #1
0
        // Updates the cropped image with the final result
        void UpdateCropped()
        {
            if (CroppedRectangle.Width == 0 || CroppedRectangle.Height == 0 || OnlySelectionRectangle)
            {
                return;
            }

            var cropped = new Bitmap(CroppedRectangle.Width, CroppedRectangle.Height);

            using (Graphics g = Graphics.FromImage(cropped))
            {
                g.DrawImage(
                    OriginalImage,
                    new Rectangle(0, 0, cropped.Width, cropped.Height),
                    CroppedRectangle,
                    GraphicsUnit.Pixel);
            }

            ActionForm.PerformAction(cropped);
        }
Beispiel #2
0
        void Gkh_KeyDown(object sender, KeyEventArgs e)
        {
            Thread.Sleep(Settings.GetValue <int>("delay"));
            bool captureCursor = Settings.GetValue <bool>("captureCursor");

            if (!e.Shift) // Screenshot
            {
                if (e.Control)
                {
                    ActionForm.PerformAction(Screenshot.CaptureScreen(captureCursor));
                }
                else if (e.Alt)
                {
                    ActionForm.PerformAction(Screenshot.CaptureActiveWindow(captureCursor));
                }
                else
                {
                    new CropForm(Screenshot.CaptureScreen(captureCursor)).Show();
                }
            }
            else // Gif capture
            {
                if (e.Control)
                {
                    new GifForm(captureCursor, Screen.PrimaryScreen.Bounds).Show();
                }
                else if (e.Alt)
                {
                    new GifForm(captureCursor, Screenshot.GetActiveWindowRect()).Show();
                }
                else
                {
                    var rectangle = CropForm.ShowRectangle(Screenshot.CaptureScreen(captureCursor));
                    if (rectangle.Width > 0 && rectangle.Height > 0)
                    {
                        new GifForm(captureCursor, rectangle).Show();
                    }
                }
            }
        }
Beispiel #3
0
 void saveAsTSB_Click(object sender, EventArgs e)
 {
     Text = "Guardando archivo...";
     Text = ActionForm.PerformAction(editControl.GetFinalResult(), ActionForm.Action.SaveAs);
     infoTimer.Enabled = false; infoTimer.Enabled = true;
 }
Beispiel #4
0
 void saveTSB_Click(object sender, EventArgs e)
 {
     Text = "Archivo guardado en " +
            ActionForm.PerformAction(editControl.GetFinalResult(), ActionForm.Action.Save);;
     infoTimer.Enabled = false; infoTimer.Enabled = true;
 }
Beispiel #5
0
 // Copy or save
 void clipboardTSB_Click(object sender, EventArgs e)
 {
     ActionForm.PerformAction(editControl.GetFinalResult(), ActionForm.Action.Clipboard);
     Text = "Copiado al portapapeles";
     infoTimer.Enabled = false; infoTimer.Enabled = true;
 }