Commit deaffbad 张东亮

监控相机显示更新camera库

1 个父辈 3c644dab
此文件类型无法预览
......@@ -65,8 +65,8 @@ public class HIKCamera
return false;
}
//PictureBox p1 = new PictureBox();
camera.Open(DeviceName);
camera.PreviewImage(DeviceName, picture.Handle);
camera.Open(DeviceName);
Bitmap bmp = camera.GetImage(DeviceName);
if (bmp == null)
{
......@@ -74,10 +74,10 @@ public class HIKCamera
LogUtil.error(Name + $"监控相机打开失败");
return false;
}
camerathread = new Thread(new ThreadStart(startCamera));
camerathread.Start();
GC.KeepAlive(camerathread);
return true;
}
int errortimes = 0;
......
......@@ -20,6 +20,7 @@ namespace TheMachine
{
public Form1()
{
CheckForIllegalCrossThreadCalls = false;
crc.OpenResourceLog = true;
InitializeComponent();
this.FormClosing += Form1_FormClosing;
......@@ -148,7 +149,7 @@ namespace TheMachine
this.Invoke((EventHandler<Bitmap>)delegate
{
pictureBox1.Visible = true;
// pictureBox1.Image = e;
pictureBox1.Image = e;
}, sender, e);
}
private void CameraB_camera_event(object sender, Bitmap e)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!