From ac93c4092a21dbf0fa9cf8b9b1302f2d5d183f61 Mon Sep 17 00:00:00 2001 From: yanjinhui <3306209981@qq.com> Date: 星期一, 09 六月 2025 20:48:20 +0800 Subject: [PATCH] 修改提示字段 --- project/人脸识别插件/FaceSdkX64/FaceSdkX64Service/CHS_Capture.cs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git "a/project/\344\272\272\350\204\270\350\257\206\345\210\253\346\217\222\344\273\266/FaceSdkX64/FaceSdkX64Service/CHS_Capture.cs" "b/project/\344\272\272\350\204\270\350\257\206\345\210\253\346\217\222\344\273\266/FaceSdkX64/FaceSdkX64Service/CHS_Capture.cs" new file mode 100644 index 0000000..ee830eb --- /dev/null +++ "b/project/\344\272\272\350\204\270\350\257\206\345\210\253\346\217\222\344\273\266/FaceSdkX64/FaceSdkX64Service/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 FaceSdkX64Service +{ + // 鐩告満鍙栧抚鍙婂抚鍥捐薄鏄剧ず缁勪欢 + 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