From a68073a77792dc96cecbfb79693d531bc51ebbac Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 08 八月 2025 18:01:35 +0800
Subject: [PATCH] 1. 修复保存图片分配率问题 2. 修复获取相机配置的问题 3. 添加侧面检的视觉模块

---
 EdgeInspector_App/InterfaceManager.cpp |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/EdgeInspector_App/InterfaceManager.cpp b/EdgeInspector_App/InterfaceManager.cpp
index 86bd20c..92fd985 100644
--- a/EdgeInspector_App/InterfaceManager.cpp
+++ b/EdgeInspector_App/InterfaceManager.cpp
@@ -1825,7 +1825,13 @@
 	strSavePath += _T(".jpg");
 
 	Lock();
-	FIBITMAP* bitmap = FreeImage_Allocate(IMAGE_WIDTH, nLineCnt, 8);
+	FIBITMAP* bitmap = nullptr;
+	int nImageWidth = IMAGE_WIDTH;
+	if (iSide > DIMENSION_D_DN) {
+		nImageWidth = IMAGE_WIDTH / 2;
+	}
+	bitmap = FreeImage_Allocate(nImageWidth, nLineCnt, 8);
+
 	if (bitmap == NULL) {
 		Unlock();
 		return FALSE;
@@ -1844,7 +1850,7 @@
 		return FALSE;
 	}
 
-	CopyMemory(pBitBuffer, lpImg, IMAGE_WIDTH * nLineCnt);
+	CopyMemory(pBitBuffer, lpImg, nImageWidth * nLineCnt);
 
 	USES_CONVERSION;
 	char str_filename[1024];

--
Gitblit v1.9.3