private bool SetPreview() { #region SetPreview switch (this._selectedPrevMode) { case PrevMode.directDraw: RSRect rect = new RSRect(); RS_SDK.GetClientRect(PreviewWindow.Handle, ref rect); m_result = RS_SDK.RS_SetViewWindow(this.deviceHandle, PreviewWindow.Handle, rect, false); if (m_result != RS_SDK.RS_SUCCESS) { RS_SDK.RS_GetErrString(m_result, ref m_errorMsg); MsgPanel.Text = m_errorMsg; return(false); } m_prevStopped = false; //ClearAllOverlays.Enabled = true; //DrawOverlay.Enabled = true; PreviewWindow.Invalidate(); PreviewWindow.Show(); break; //case PrevMode.callbackDraw: // m_result = RS_SDK.RS_RegisterPreviewCallback(deviceHandle, previewCallback); // if (m_result != RS_SDK.RS_SUCCESS) // { // RS_SDK.RS_GetErrString(m_result, ref m_errorMsg); // MsgPanel.Text = m_errorMsg; // } // break; //case PrevMode.advCallbackDraw: // m_result = RS_SDK.RS_RegisterAdvPreviewCallback(deviceHandle, advPreviewCallback); // if (m_result != RS_SDK.RS_SUCCESS) // { // RS_SDK.RS_GetErrString(m_result, ref m_errorMsg); // MsgPanel.Text = m_errorMsg; // } // break; default: break; } return(true); #endregion }