using System; using System.Drawing; using DevExpress.XtraEditors; using System.Windows.Forms; namespace TsSFCDevice.Client.Launch.Common { public partial class CameraDialog : XtraForm { public Image CameraImage { get; set; } public CameraDialog() { InitializeComponent(); } private void CameraDialog_Load(object sender, EventArgs e) { cameraControl1.DeviceNotFoundString = "未能获取设备摄像头或摄像头处于禁用状态。"; if (cameraControl1.Device!= null && cameraControl1.Device.IsRunning) { btn_Photograph.Enabled = true; } } /// /// 拍照 /// /// /// private void btn_Photograph_Click(object sender, EventArgs e) { CameraImage = cameraControl1.Device.TakeSnapshot(); this.DialogResult = DialogResult.OK; } /// /// 取消 /// /// /// private void btn_Cancel_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; } } }