Exemplo n.º 1
0
        public void SetRect()
        {
            if (isDragMode) return;
            isDragMode = true;

            dragForm d = new dragForm();
            d.dragFinished += (rect, img) =>
            {
                this.Rect = rect;
                isDragMode = false;
                HotKeyManager.SaveRect(this);
                img.Dispose();
            };
            d.dragCanceled += () => { isDragMode = false; };
            d.ShowDialog();
        }
Exemplo n.º 2
0
        public override void CaptureSShot()
        {
            if (isDragMode) return;
            isDragMode = true;

            dragForm d = new dragForm();
            d.dragFinished += (rect, capturedSS) =>
            {
                string path = HotKeyManager.SaveImage(capturedSS);
                HotKeyManager.ShowImageEditor(path, capturedSS);

                isDragMode = false;

                if (capturedSS != null) capturedSS.Dispose();
                GC.Collect();
                GC.WaitForPendingFinalizers();
            };
            d.dragCanceled += () => { isDragMode = false; };
            d.ShowDialog();
        }