From ee5e3a086a5dc145e7f5df3de32e0e072c183949 Mon Sep 17 00:00:00 2001 From: z8018 <1282578289@qq.com> Date: 星期五, 06 六月 2025 15:19:40 +0800 Subject: [PATCH] 1 --- project/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Face/CHS_Capture.cs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/project/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Face/CHS_Capture.cs b/project/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Face/CHS_Capture.cs new file mode 100644 index 0000000..860c160 --- /dev/null +++ b/project/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Face/CHS_Capture.cs @@ -0,0 +1,49 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEAWCS_Common.Face +{ + // 鐩告満鍙栧抚鍙婂抚鍥捐薄鏄剧ず缁勪欢 + public class CHS_Capture + { + // 杩斿洖鐩告満涓暟 + [DllImport("SmCameraPreview.dll", EntryPoint = "SmCameraGetCount", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] + public static extern int SmCameraGetCount(); + + // 鎵撳紑鐩告満锛堟牴鎹浉鏈虹储寮曞彿 nDeviceId锛� + [DllImport("SmCameraPreview.dll", EntryPoint = "SmCameraOpen", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] + public static extern IntPtr SmCameraOpen(int nDeviceId, int nWidth, int nHeight); + + // 鎵撳紑鐩告満锛堟牴鎹浉鏈篤ID+PIC锛� + [DllImport("SmCameraPreview.dll", EntryPoint = "SmCameraOpenEx", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] + public static extern IntPtr SmCameraOpenEx(int nVid, int nPid, int nWidth, int nHeight); + + // 浠庢墦寮�鐨勭浉鏈烘彁鍙栦竴甯ц棰戞暟鎹� + [DllImport("SmCameraPreview.dll", EntryPoint = "SmCameraGetFrame", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] + public static extern int SmCameraGetFrame(IntPtr hCamera, IntPtr pFrameBuf, int bMirror, int bFlip); + + // 鍏抽棴鐩告満 + [DllImport("SmCameraPreview.dll", EntryPoint = "SmCameraClose", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] + public static extern void SmCameraClose(IntPtr hCamera); + + // 鍒涘缓瑙嗛甯ф樉绀哄璞★紙nWidth * nHeight 涓鸿棰戝抚鐨勫垎杈ㄧ巼锛宧Wnd 涓烘樉绀虹獥鍙e彞鏌勶級 + [DllImport("SmCameraPreview.dll", EntryPoint = "SmCameraPreviewCreate", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] + public static extern IntPtr SmCameraPreviewCreate(int nWidth, int nHeight, IntPtr hWND); + + // 鏄剧ず瑙嗛甯� + [DllImport("SmCameraPreview.dll", EntryPoint = "SmCameraPreview", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] + public static extern void SmCameraPreview(IntPtr hCameraPreview, IntPtr pFrame); + + // 鏄剧ず瑙嗛甯у強浜鸿劯妗嗭紙weight涓鸿竟妗嗙殑鍘氬害锛� + [DllImport("SmCameraPreview.dll", EntryPoint = "SmCameraPreviewFace", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] + public static extern void SmCameraPreviewFace(IntPtr hCameraPreview, IntPtr pFrame, int left, int top, int right, int bottom, int weight, int color); + + // 閲婃斁瑙嗛甯ф樉绀哄璞� + [DllImport("SmCameraPreview.dll", EntryPoint = "SmCameraPreviewDestroy", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] + public static extern void SmCameraPreviewDestroy(IntPtr hCameraPreivew); + } +} -- Gitblit v1.9.3