Пример #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);
        }
Пример #2
0
        void BeginInit()
        {
            InitializeComponent();
            Icon = Properties.Resources.appiconsmall;
            Text = screenshotName = ActionForm.GetAutoFormat();

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

            editControl.Operation += EditControl_Operation;
        }
Пример #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());
        }
Пример #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);
        }
Пример #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);
        }
Пример #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();
                    }
                }
            }
        }
Пример #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;
 }
Пример #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;
 }
Пример #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;
 }
Пример #10
0
 EditGifForm()
 {
     InitializeComponent();
     Icon = Properties.Resources.appiconsmall;
     Text = gifName = ActionForm.GetAutoFormat();
 }