示例#1
0
        public bool StartScan(ScanSettings settings, object extTag)
        {
            bool scanning = false;

            try
            {
                _extTag = extTag;
                _messageHook.UseFilter = true;
                scanning = DataSource.Open(settings);
                return(scanning);
            }
            catch (TwainException e)
            {
                DataSource.Close();
                EndingScan();
                throw e;
            }
            finally
            {
                // Remove the message hook if scan setup failed
                if (!scanning)
                {
                    EndingScan();
                }
            }
        }
        /// <summary>
        /// 做open→設定各種CAPABILITY→EnableDS→等回傳圖→end
        /// </summary>
        /// <param name="settings"></param>
        public void StartScan(ScanSettings settings)
        {
            bool scanning = false;

            try
            {
                _messageHook.UseFilter = true;
                scanning = DataSource.Open(settings, UseIncrementalMemoryXfer);
            }
            catch (TwainException e)
            {
                DataSource.Close();
                EndingScan();
                throw e;
            }
            finally
            {
                // Remove the message hook if scan setup failed
                if (!scanning)
                {
                    EndingScan();
                }
            }
        }