예제 #1
0
 public MainWindow()
 {
     DBAccessProc.ConfigurationManager.ConfigFileName = "TraineeManage.config";
     //注册控件
     if (dsrsrc.RegisterControls("TrainingAccounter"))
     {
         axLibCtl = new AxLib.AxLibControl();
     }
     InitializeComponent();
     statusBarItem.SetBinding(System.Windows.Controls.Primitives.StatusBarItem.ContentProperty, new Binding("MainBarText")
     {
         Source = dsrsrc
     });
     tbxTitle.Text     = "驾训管理系统   主版本:1.0";
     statusBar.Content = "版本详情:" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
     //读卡器线程
     SearchExamineeThread = new Thread(new ThreadStart(SearchExaminee));
     SearchExamineeThread.IsBackground = true;
     SearchExamineeThread.Start();
 }
예제 #2
0
        //调用摄像头拍照
        public byte[] getPhotoFromCamra()
        {
            byte[] gbuffer = null;
            axLibCtl = new AxLib.AxLibControl();
            try
            {
                string picName = DBAccessProc.Common.TempFilePath + @"\" + System.DateTime.Now.ToString("HH-mm-ss") + ".jpg";
                axLibCtl.ps = new AxLib.PhotoSnapper(picName);
                axLibCtl.ps.ShowDialog();

                System.IO.FileInfo fi = new System.IO.FileInfo(picName);
                if (fi.Exists)
                {
                    axLibCtl.ImageBuffer(picName, ref gbuffer);
                }
                return(gbuffer);
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("系统错误:" + ex.Message);
                return(null);
            }
        }