/// <summary> /// show the snapshot or preview picturebox in front /// </summary> /// <param name="bShow">true for snapshot /// false for preview</param> private void showSnapshot(bool bShowHide) { if (this.InvokeRequired) { setShowSnapshot d = new setShowSnapshot(showSnapshot); this.Invoke(d, bShowHide); } else { #if USEGDI addLog("showSnapshot() called with " + bShowHide.ToString()); if (bShowHide) { CameraSnapshot.Visible = true; CameraPreview.Visible = false; ImageIsReady(); CameraSnapshot.BringToFront(); } else { CameraSnapshot.Visible = false;// BringToFront(); CameraPreview.Visible = true; CameraPreview.BringToFront(); ImageIsInPreview(); } _bIsSnapshotView = bShowHide; addLog("showSnapshot() call end."); #else return; #endif } }
/// <summary> /// show or hide preview with running video or the last taken snapshot /// </summary> /// <param name="bShowHide">true to show running video /// false to show saved image</param> private void showSnapshot(bool bShowHide) { if (this.InvokeRequired) { setShowSnapshot d = new setShowSnapshot(showSnapshot); this.Invoke(d, bShowHide); } else { addLog("showSnapshot() called with " + bShowHide.ToString()); if (bShowHide) { // CameraSnapshot.BringToFront(); ImagerSnapshot.Visible = true; ImagerPreview.Visible = false; ImageIsReady(); } else { //CameraPreview.BringToFront(); ImagerSnapshot.Visible = false;// BringToFront(); ImagerPreview.Visible = true; ImageIsInPreview(); } _bIsSnapshotView = bShowHide; addLog("showSnapshot() call end."); #if STREAMING_ON #else _imager.VideoRunning = bShowHide; #endif } }