Beispiel #1
0
        //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);
            }
        }
Beispiel #2
0
        //"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;
            }
        }