求懂得 C# WPF项目开发的进来帮忙读一下代码,谢谢
privatevoidbtnStart_Click(objectsender,RoutedEventArgse){if(btnStart.Tag.ToString()==...
private void btnStart_Click(object sender, RoutedEventArgs e)
{
if (btnStart.Tag.ToString() == "0")
{
if (_VedioAndController == null)
_VedioAndController = new IpCameraHelper(GetConfigValue("RoundVedioIp"), GetConfigValue("RoundVedioUserName"), GetConfigValue("RoundVedioPassWord"),
new Action<ImageEventArgs>((arg) =>
{
img.Source = arg.FrameReadyEventArgs.BitmapImage;
}));
_VedioAndController.StartProcessing();
btnStart.Content = "关闭";
btnStart.Tag = "1";
}
else
{
if (_VedioAndController != null)
_VedioAndController.StopProcessing();
btnStart.Content = "打开";
btnStart.Tag = "0";
}
} 展开
{
if (btnStart.Tag.ToString() == "0")
{
if (_VedioAndController == null)
_VedioAndController = new IpCameraHelper(GetConfigValue("RoundVedioIp"), GetConfigValue("RoundVedioUserName"), GetConfigValue("RoundVedioPassWord"),
new Action<ImageEventArgs>((arg) =>
{
img.Source = arg.FrameReadyEventArgs.BitmapImage;
}));
_VedioAndController.StartProcessing();
btnStart.Content = "关闭";
btnStart.Tag = "1";
}
else
{
if (_VedioAndController != null)
_VedioAndController.StopProcessing();
btnStart.Content = "打开";
btnStart.Tag = "0";
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询