Ejemplo n.º 1
0
        async void saveAsTSB_Click(object sender, EventArgs e)
        {
            var file = ActionForm.GetGifSaveLocation(ActionForm.Action.SaveAs);

            if (string.IsNullOrEmpty(file))
            {
                return;
            }

            await doSave(file);
        }
Ejemplo n.º 2
0
        void BeginInit()
        {
            InitializeComponent();
            Icon = Properties.Resources.appiconsmall;
            Text = screenshotName = ActionForm.GetAutoFormat();

            sec1Timer.Tick += ShowColorPalette;
            infoTimer.Tick += InfoTimer_Tick;

            editControl.Operation += EditControl_Operation;
        }
Ejemplo n.º 3
0
        async Task Stop()
        {
            if (stopped)
            {
                return;
            }
            stopped = true;

            selectedRectangle = oversizedRect = Rectangle.Empty;
            captureT.Enabled  = false;

            playPauseB.Visible = stopB.Visible = false;
            timeL.Text         = "";
            Invalidate();
            await SaveAsync(ActionForm.GetGifSaveLocation());
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        public static string GetGifSaveLocation()
        {
            Init(true);

            if (!AnyGifAction())
            {
                SetFileName(Action.SaveAs); // Default action
            }
            else if (EnabledActions.Count == 1)
            {
                SetFileName(EnabledActions[0]);
            }

            else
            {
                using (var af = new ActionForm(true))
                    af.ShowDialog();
            }

            return(SelectedFile);
        }
Ejemplo n.º 6
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();
                    }
                }
            }
        }
Ejemplo n.º 7
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;
 }
Ejemplo n.º 8
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;
 }
Ejemplo n.º 9
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;
 }
Ejemplo n.º 10
0
 EditGifForm()
 {
     InitializeComponent();
     Icon = Properties.Resources.appiconsmall;
     Text = gifName = ActionForm.GetAutoFormat();
 }