private void LiveBtn_Click(object sender, EventArgs e) { if (info != null) { if (LiveBtn.Text == "Live") { LiveBtn.Text = "Stop"; if (!CameraManger.StartLive(info.UserID)) { MessageHelper.ShowError("打开实时拍照失败,相机出现错误,请关闭连接后重新启动或者检查相机设置!"); } } else if (LiveBtn.Text == "Stop") { LiveBtn.Text = "Live"; if (!CameraManger.StopLive(info.UserID)) { MessageHelper.ShowError("打开实时拍照失败,相机出现错误,请关闭连接后重新启动或者检查相机设置!"); } } } else { MessageHelper.ShowError("拍照失败,无法获取相机信息!请关闭连接后重新启动或者检查相机设置!"); } }
private void CameraSetting_FormClosing(object sender, FormClosingEventArgs e) { if (info != null) { CameraManger.StopLive(info.UserID); } e.Cancel = true; this.Hide(); }