//异步方法
        private void GetText(object ex)
        {
            //Imge_ShowArea.Dispatcher.Invoke(new Action(delegate//begainInvoke好用
            //{
            FileSystemEventArgs e= (FileSystemEventArgs)ex;
                BitmapImage imag = new BitmapImage();
                imag.BeginInit();
            try
            {
                FileStream FS = new FileStream(e.FullPath, FileMode.Open);
                imag.StreamSource = FS;
                byte[] imagbyte = ToByteArray(imag);
                FS.Close();
                imag.EndInit();

                Imge_ShowArea.Dispatcher.BeginInvoke(new Action(delegate
                {

                        BitmapImage newimag = ToImage(imagbyte);

                        Imge_ShowArea.Source = newimag;
                    

                }));
                
                    if (m_IfAutoStart)
                    {
  
                            string paths = UserNameConverter(@”C:\Users\Administrator\Desktop\TARGET”, false, m_Count, “VID+PID”);//m_autoCount
                            File.Copy(e.FullPath, paths);
                            m_Count++;
                    }
                }
                catch (System.Exception esx)
                {                    
                }
            //}));

        }


版权声明:本文为qq_40034982原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/qq_40034982/article/details/117433748