Commit deaffbad 张东亮

监控相机显示更新camera库

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