From d0ded5cd9bf5070a120bad58b5be21fe2ac6a4ff Mon Sep 17 00:00:00 2001
From: C3032 <C3032@BC3032>
Date: 星期六, 20 十二月 2025 16:41:09 +0800
Subject: [PATCH] test

---
 IDViewer_2D/IDViewerSDK1.cs |  230 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 230 insertions(+), 0 deletions(-)

diff --git a/IDViewer_2D/IDViewerSDK1.cs b/IDViewer_2D/IDViewerSDK1.cs
new file mode 100644
index 0000000..4f8fa5e
--- /dev/null
+++ b/IDViewer_2D/IDViewerSDK1.cs
@@ -0,0 +1,230 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Runtime.InteropServices;
+using static IDViewer_2D.IDViewerDefines;
+
+namespace IDViewer_2D
+{   
+    class IDViewerSDK
+    {
+        public class Node
+        {
+            public IDViewerDefines.IDDeviceInfo data;
+            public Node next;
+        }
+
+        public struct LinkedList
+        {
+            public Node head;
+            [MarshalAs(UnmanagedType.SysInt)]
+            public int size;
+        }
+        /****************************************
+         IDImage
+        //*****************************************/
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDImage_Init", CharSet = CharSet.Ansi)]
+        public static extern long IDImage_Init(ref IntPtr imagePtr);
+
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDImage_Destroy", CharSet = CharSet.Ansi)]
+            public static extern void IDImage_Destroy(ref IntPtr imagePtr);
+ 
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDImage_Width", CharSet = CharSet.Ansi)]
+            public static extern long IDImage_Width(IntPtr imageHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDImage_Height", CharSet = CharSet.Ansi)]
+            public static extern long IDImage_Height(IntPtr imageHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDImage_Step", CharSet = CharSet.Ansi)]
+            public static extern long IDImage_Step(IntPtr imageHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDImage_BitDepth", CharSet = CharSet.Auto)]
+            public static extern long IDImage_BitDepth(IntPtr imageHandle,ref IntPtr imageType);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDImage_Channels", CharSet = CharSet.Ansi)]
+            public static extern long IDImage_Channels(IntPtr imageHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDImage_ImageData", CharSet = CharSet.Ansi)]
+            public static extern IntPtr IDImage_ImageData(IntPtr imageHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDImage_SaveImage", CharSet = CharSet.Ansi)]
+            public static extern long IDImage_SaveImage(IntPtr imageHandle, string filePath, int compression);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDImage_SaveImageW", CharSet = CharSet.Unicode)]
+            public static extern long IDImage_SaveImageW(IntPtr imageHandle, string filePath, int compression);
+
+
+            /****************************************
+            IDDevice
+            *****************************************/
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_Open", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_Open(IntPtr deviceHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_IsOpen", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_IsOpen(IntPtr deviceHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_StartRunning", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_StartRunning(IntPtr deviceHandle,int isCallBack);  //isCallBack>0 娉ㄥ唽鍥炶皟锛岀瓑浜�0 涓嶆敞鍐屽洖璋�
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_StartDebugging", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_StartDebugging(IntPtr deviceHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_IsRunning", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_IsRunning(IntPtr deviceHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_IsConnected", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_IsConnected(IntPtr deviceHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_Stop", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_Stop(IntPtr deviceHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_Close", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_Close(IntPtr deviceHandle);
+
+        /****************************************
+        DeviceInfo 
+        *****************************************/
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_GetDeviceInfo", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_GetDeviceInfo(IntPtr deviceHandle, ref IDDeviceInfo DeviceInfoHandel);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_GetHardWareParams", CharSet = CharSet.Ansi)]
+            public static extern IDViewerDefines.IDDeviceHarewareParams IDDevice_GetHardWareParams(IntPtr deviceHandle);
+
+            //姝ゆ帴鍙i渶瑕乂S2019浠ヤ笂鐗堟湰锛孋#7.0鏇存柊鏀寔寮曞叆浜嗘柊鐨勮娉時ef return鍜宺ef locals锛屽厑璁稿嚱鏁扮殑杩斿洖鍊间篃鍙互琚0鏄庝负寮曠敤
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_GetSolutionList", CharSet = CharSet.Ansi)]
+            public static extern ref StringList  IDDevice_GetSolutionList(IntPtr deviceHandle,  int timeout = 2000);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_SetRunningSolution", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_SetRunningSolution(IntPtr deviceHandle,byte[] solutionName, int timeout = 2000);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_GetRunningSolution", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_GetRunningSolution(IntPtr deviceHandle, byte[] solutionName, int timeout = 2000);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_DeleteSolution", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_DeleteSolution(IntPtr deviceHandle, string solutionName, int timeout = 2000);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_Release", CharSet = CharSet.Ansi)]
+            public static extern void IDDevice_Release(IntPtr deviceHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_FreeSolutionList", CharSet = CharSet.Ansi)]
+            public static extern void IDDevice_FreeSolutionList(StringList solutionList);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_GetIlluminanatbrightnessLength", CharSet = CharSet.Ansi)]
+            public static extern long IDDevice_GetIlluminanatbrightnessLength(IntPtr deviceHandle);
+
+            [DllImport("IDViewerCSDK.dll", EntryPoint = "IDDevice_GetIlluminanatbrightness", CharSet = CharSet.Ansi)]
+            public static extern IDNodeParam IDDevice_GetIlluminanatbrightness(IntPtr deviceHandle, uint index);
+
+        //鍥炶皟鍑芥暟
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDCallback_ResultNotify_")]
+        public static extern void IDCallback_ResultNotify_(IntPtr deviceHandle, IntPtr resCallback);
+
+        //[DllImport("IDViewerCSDK.dll", EntryPoint = "IDCallback_GetIDDecodeInfo")]
+        //public extern static IntPtr IDCallback_GetIDDecodeInfo(IntPtr decodeInfoHandel);  //IDCallback_GetIDDecodeInfo
+
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDCallback_GetIDDecodeInfo_A")]
+        public extern static long IDCallback_GetIDDecodeInfo_A(IntPtr decodeInfoHandel,ref IDDecodeInfo info);  //IDCallback_GetIDDecodeInfo
+
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDCallback_GetIDDecodeROIInfo", CharSet = CharSet.Ansi)]
+        public static extern IDDecodeROIInfo IDCallback_GetIDDecodeROIInfo(IntPtr decodeInfoHandel, uint index);
+
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDCallback_GetIDDecodeResult", CharSet = CharSet.Ansi)]
+        public static extern IDDecodeResult IDCallback_GetIDDecodeResult(IntPtr decodeInfoHandel, uint decodeROIInfoIndex, uint index);
+
+        /*
+         *decodeROIInfoIndex 绗嚑涓猂OI
+         *decodeResultIndex  鍏堝拷鐣ワ紝
+         *index  ROI鍐呯殑绗嚑涓垚鍔熻В鐮佺粨鏋�
+         */
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDCallback_GetIDDMCodeResult", CharSet = CharSet.Ansi)]
+        public static extern long IDCallback_GetIDDMCodeResult(IntPtr decodeInfoHandel, uint decodeROIInfoIndex,
+            uint decodeResultIndex, uint index, ref IDDMCodeResult IDDMCodeResultData);
+
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDCallback_GetID_QR_CODE_Result", CharSet = CharSet.Ansi)]
+        public static extern long IDCallback_GetID_QR_CODE_Result(IntPtr decodeInfoHandel, uint decodeROIInfoIndex,
+            uint decodeResultIndex, uint index,  ref IDQRCodeResult ID_QR_CODE_RESULTData);
+
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDCallback_GetIDPDF417CodeResult", CharSet = CharSet.Ansi)]
+        public static extern long IDCallback_GetIDPDF417CodeResult(IntPtr decodeInfoHandel, uint decodeROIInfoIndex,
+            uint decodeResultIndex, uint index, ref IDPDF417CodeResult IDPDF417CodeResultData);
+
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDCallback_GetIDBarCodeResult", CharSet = CharSet.Ansi)]
+        public static extern long IDCallback_GetIDBarCodeResult(IntPtr decodeInfoHandel, uint decodeROIInfoIndex,
+            uint decodeResultIndex, uint index, ref IDBarCodeResult IDBarCodeResultData);
+        /**
+        * @brief IDVIEWER_Init 浣跨敤SDK鍏朵粬鍔熻兘鍓嶉渶瑕佸厛璋冪敤璇ュ垵濮嬪寲鏂规硶
+        * @return 閿欒鐮�
+        */
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDVIEWER_Init_", CharSet = CharSet.Ansi)]
+        public extern static long IDVIEWER_Init_();
+
+        /**
+        * @brief IDVIEWER_DiscoveryDevices 鎵弿璁惧鍒楄〃
+        * @param deviceList	杩斿洖鑾峰彇鐨勮澶囧垪琛�
+        * @param discoveryTime 鎵弿鍛ㄦ湡,榛樿200(鍗曚綅姣)
+        * @return 閿欒鐮�
+        */
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDVIEWER_DiscoveryDevices_", CharSet = CharSet.Ansi)]
+        public extern static IntPtr IDVIEWER_DiscoveryDevices_(uint discoveryTime = 200);
+
+        /**
+         * @brief IDVIEWER_GetDevicesLength_ 璁惧鍒楄〃闀垮害
+         * @param deviceList	杩斿洖鑾峰彇鐨勮澶囧垪琛ㄩ暱搴�
+         * 
+         * @return 闀垮害
+         */
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDVIEWER_GetDevicesLength_", CharSet = CharSet.Ansi)]
+        public extern static long IDVIEWER_GetDevicesLength_(IntPtr DevicesList);
+
+        /**
+         * @brief IDVIEWER_SelectIDDeviceInfo_ 鑾峰彇鏌愪釜搴忓彿鐨勮澶�
+         * @param DevicesList 褰撳墠璁惧鍒楄〃鎸囬拡
+         * @param index	璁惧鍒楄〃鐨勫簭鍙�
+
+         * @return 璁惧淇℃伅
+         */
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDVIEWER_SelectIDDeviceInfo_", CharSet = CharSet.Ansi)]
+        public extern static long IDVIEWER_SelectIDDeviceInfo_(IntPtr DevicesList, ref IDDeviceInfo IDDeviceInfoHandel, uint index);
+
+        /**
+        * @brief IDVIEWER_SetIP 璁剧疆IP 璁剧疆IP鍚庨渶瑕侀噸鏂版壂鎻�
+        * @param deviceInfo 褰撳墠璁惧淇℃伅
+        * @param iPv4	鏂扮殑IP鍦板潃
+        * @param mask	鏂扮殑MASK鍦板潃
+        * @param gateway 鏂扮殑缃戝叧鍦板潃
+        * @param isStatic 鏄惁璁剧疆闈欐�両P(false涓轰复鏃禝P)
+        * @return 閿欒鐮�
+        */
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDVIEWER_SetIP_", CharSet = CharSet.Ansi)]
+        public static extern long IDVIEWER_SetIP_(ref IDViewerDefines.IDDeviceInfo deviceInfo, string iPv4, string mask, string gateway, bool isStatic);
+
+
+        /**
+	     * @brief IDVIEWER_CreateDevice IDVIEWER_CreateDeviceBySN 鏇村姞SN鍒涘缓璁惧
+	     * @param cameraSN 褰撳墠璁惧SN
+	     * @param device 鍒涘缓鐨勮澶囨寚閽�
+	     * @return 閿欒鐮�
+	     */
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDVIEWER_CreateDeviceBySN_", CharSet = CharSet.Ansi)]
+        public static extern long IDVIEWER_CreateDeviceBySN_(string cameraSN, ref IntPtr deviceHandle);
+
+        /**
+         * @brief IDVIEWER_CreateDevice IDVIEWER_CreateDeviceByIP 鏇村姞SN鍒涘缓璁惧
+         * @param cameraIP 褰撳墠璁惧IP
+         * @param device 鍒涘缓鐨勮澶囨寚閽�
+         * @return 閿欒鐮�
+         */
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDVIEWER_CreateDeviceByIP_", CharSet = CharSet.Ansi)]
+        public static extern long IDVIEWER_CreateDeviceByIP_(string cameraIP, ref IntPtr deviceHandle);
+        /**
+        * @brief IDVIEWER_UnInit 浣跨敤瀹孲DK鍚庤皟鐢ㄩ噴鏀捐祫婧�
+        * @return 閿欒鐮�
+        */
+        [DllImport("IDViewerCSDK.dll", EntryPoint = "IDVIEWER_UnInit_", CharSet = CharSet.Ansi)]
+        public static extern long IDVIEWER_UnInit_(IntPtr deviceList);
+    }
+}
+
+
+

--
Gitblit v1.9.3