protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); Rectangle capture = this._captureLayer.Capture; if (capture.Width > 0 && capture.Height > 0) { this._isExploring = false; this._isCapturing = false; this._isCaptured = true; this._defaultEditLayer = new DefaultEditLayer(this.Size, capture); } else { this._isExploring = true; this._isCapturing = false; this._isCaptured = false; } }
private void MiniCaptor_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Escape && e.KeyCode != Keys.Space) { return; } if (e.KeyCode == Keys.Escape) { if (this._isCapturing || this._isCaptured) { this._isCapturing = this._isCaptured = false; this._defaultEditLayer = null; this._isExploring = true; this.Invalidate(); return; } if (this._isExploring) { this.Close(); } } else { if (!this._isCaptured) { return; } this._isCaptured = this._isCapturing = false; this._isExploring = true; byte[] imageData = ImageUtil.GetTargetImageToBytes(this._baseImage, this._captureLayer.Capture); OnImageDataAcquired(new ImageDataAcquiredEventArgs(imageData)); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); this._defaultEditLayer = new DefaultEditLayer(this.Size, this._capture); }