public void InitCamera() { Camera = new uEye.Camera(); uEye.Defines.Status statusRet = 0; // Open Camera statusRet = Camera.Init(); if (statusRet != uEye.Defines.Status.Success) { //MessageBox.Show("Camera initializing failed"); Environment.Exit(-1); } Camera.Trigger.Set(uEye.Defines.TriggerMode.Software); uEye.Types.ImageFormatInfo[] FormatInfoList; Camera.Size.ImageFormat.GetList(out FormatInfoList); int count = FormatInfoList.Count(); Camera.Size.ImageFormat.Set((uint)FormatInfoList[10].FormatID); // Allocate Memory statusRet = Camera.Memory.Allocate(); if (statusRet != uEye.Defines.Status.Success) { // MessageBox.Show("Allocate Memory failed"); Environment.Exit(-1); } // //Camera.Size.ImageFormat.Set(4192*3104); //// Start Live Video //statusRet = Camera.Acquisition.Capture(); //if (statusRet != uEye.Defines.Status.Success) //{ // //MessageBox.Show("Start Live Video failed"); //} //else //{ // bLive = true; //} // Connect Event Camera.EventFrame += onFrameEvent; }
/// <summary> /// 开始实时显示 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { Camera.Focus.Auto.SetEnable(true); showLog("开始实时显示"); imageBox.Image = null; Camera.Trigger.Set(uEye.Defines.TriggerMode.Continuous); uEye.Types.ImageFormatInfo[] FormatInfoList; Camera.Size.ImageFormat.GetList(out FormatInfoList); int count = FormatInfoList.Count(); Camera.Size.ImageFormat.Set((uint)FormatInfoList[0].FormatID); if (Camera.Acquisition.Capture() == uEye.Defines.Status.Success) { bLive = true; } }