Beispiel #1
0
        // Snap
        //    Acquire image(s)
        //
        private bool Snap()
        {
            // Check if the transfer object is available
            if (m_pXfer == null || !m_pXfer.Initialized)
            {
                return(false);
            }

            for (int iFrame = 0; iFrame < m_pLocalBuffer.Count; iFrame++)
            {
                // Acquire one image
                m_pXfer.Snap();

                // Wait until the acquired image has been transferred into system memory
                AbortDlg abort = new AbortDlg(m_pXfer);
                if (abort.ShowDialog() != DialogResult.OK)
                {
                    m_pXfer.Abort();
                    return(false);
                }

                //Add a short delay to ensure the transfer callback has time to arrive
                System.Threading.Thread.Sleep(100);

                if (m_pLocalBuffer != null)
                {
                    m_pLocalBuffer.Index = iFrame;
                    m_pLocalBuffer.Copy(m_pBuffer);
                }
            }
            return(true);
        }
Beispiel #2
0
        public void SaperaInterface_GrabStop()
        {
            string Str = string.Empty;

            if (m_Xfer != null && m_Xfer.Initialized)
            {
                //Form_GrabAbort Abort = new Form_GrabAbort(m_Xfer);
                if (m_Xfer.Freeze())
                {
                    m_Xfer.Abort();
                }
                else
                {
                    //Str = Global._localResource.GetString("SaperaCenter_Error_StopGrabFailed");
                    //Global.g_Form_EventLog.Form_EventLog_AddErrorMsg(Str, true);
                    //Global.LogErrorFun(Str);
                }
            }
        }