//Make Image from custom Coords private void Crop(Point from, Point to) { int w = (int)(to.X - from.X); int h = (int)(to.Y - from.Y); try { Rectangle size = new Rectangle((int)from.X, (int)from.Y, w, h); using (GifRecorder recorder = new GifRecorder(size)) { bool?result = recorder.ShowDialog(); if (result != true) { CloseSnap(false, 0, recorder.ErrorMsg); return; } SelectionStream = recorder.Gif; } CloseSnap(true); } catch { CloseSnap(false, 0, strings.couldNotStartRecording); } }
//"Crop" Rectangle private void StartGif(Rectangle size) { //Stop recording after 10 Secs //CHANGE THIS IF YOU WANT LONGER CAPTURES TimeSpan recordingLength = TimeSpan.FromMilliseconds(FileIO.GifLength); using (GifRecorder recorder = new GifRecorder(size, recordingLength)) { bool?result = recorder.ShowDialog(); CroppedGif = recorder.Gif; DialogResult = result; } }