async void saveAsTSB_Click(object sender, EventArgs e) { var file = ActionForm.GetGifSaveLocation(ActionForm.Action.SaveAs); if (string.IsNullOrEmpty(file)) { return; } await doSave(file); }
void BeginInit() { InitializeComponent(); Icon = Properties.Resources.appiconsmall; Text = screenshotName = ActionForm.GetAutoFormat(); sec1Timer.Tick += ShowColorPalette; infoTimer.Tick += InfoTimer_Tick; editControl.Operation += EditControl_Operation; }
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()); }
// 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); }
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); }
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(); } } } }
void saveAsTSB_Click(object sender, EventArgs e) { Text = "Guardando archivo..."; Text = ActionForm.PerformAction(editControl.GetFinalResult(), ActionForm.Action.SaveAs); infoTimer.Enabled = false; infoTimer.Enabled = true; }
void saveTSB_Click(object sender, EventArgs e) { Text = "Archivo guardado en " + ActionForm.PerformAction(editControl.GetFinalResult(), ActionForm.Action.Save);; infoTimer.Enabled = false; infoTimer.Enabled = true; }
// 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; }
EditGifForm() { InitializeComponent(); Icon = Properties.Resources.appiconsmall; Text = gifName = ActionForm.GetAutoFormat(); }