From a0c982ba8abdbd7569a6cae07812127a757fd410 Mon Sep 17 00:00:00 2001
From: C3032 <C3032@BC3032>
Date: 星期三, 07 一月 2026 16:02:34 +0800
Subject: [PATCH] 更新相机实例化和UI线程处理逻辑
---
LB_VisionProcesses/Cameras/2DCameraForm.cs | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/LB_VisionProcesses/Cameras/2DCameraForm.cs b/LB_VisionProcesses/Cameras/2DCameraForm.cs
index 3d9057a..9558b6e 100644
--- a/LB_VisionProcesses/Cameras/2DCameraForm.cs
+++ b/LB_VisionProcesses/Cameras/2DCameraForm.cs
@@ -390,21 +390,20 @@
if (e.Bitmap == null)
return;
- lock (e.Bitmap)
- {
- if (this.InvokeRequired) // 妫�鏌ユ槸鍚﹂渶瑕佸湪UI绾跨▼涓婅皟鐢�
+ lock (e.Bitmap)
{
- this.Invoke(new Action(() =>
+ if (this.InvokeRequired) // 妫�鏌ユ槸鍚﹂渶瑕佸湪UI绾跨▼涓婅皟鐢�
+ {
+ this.Invoke(new Action(() =>
+ {
+ onlinePictureBox.Image = e.Bitmap;
+ })); // 閫掑綊璋冪敤鑷韩锛屼絾杩欐鍦║I绾跨▼涓�
+ }
+ else
{
onlinePictureBox.Image = e.Bitmap;
- })); // 閫掑綊璋冪敤鑷韩锛屼絾杩欐鍦║I绾跨▼涓�
+ }
}
- else
- {
- onlinePictureBox.Image = e.Bitmap;
- }
- }
-
total.iImageCount++;
try
{
--
Gitblit v1.9.3