using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; namespace HNWD.LatticeScreen { internal class LedControl_bak { public const int JR_OK = 0; //public const string zkdll = "..\\..\\..\\..\\Dll\\windows\\jinhanzk.dll"; //public const string commdll = "..\\..\\..\\..\\Dll\\windows\\jinhancomm.dll"; public const string zkdll = "jinhanzk.dll"; public const string commdll = "jinhancomm.dll"; [DllImport(zkdll, EntryPoint = "JHCreateInst", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHCreateInst(ref IntPtr hdl, ushort serverid); [DllImport(zkdll, EntryPoint = "JHDeleteInst", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHDeleteInst(IntPtr hdl); [DllImport(zkdll, EntryPoint = "JHDrawText", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHDrawText(IntPtr hdl, short x, short y, ushort width, ushort height, uint format, string ptext); [DllImport(zkdll, EntryPoint = "JHDrawMultPixel", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHDrawMultPixel(IntPtr hdl, ushort[] pdat, ushort poscnt); [DllImport(zkdll, EntryPoint = "JHErase", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHErase(IntPtr hdl); [DllImport(zkdll, EntryPoint = "JHScrollRight", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHScrollRight(IntPtr hdl, short x, short y, ushort width, ushort height); [DllImport(zkdll, EntryPoint = "JHScrollLeft", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHScrollLeft(IntPtr hdl, short x, short y, ushort width, ushort height); [DllImport(zkdll, EntryPoint = "JHDrawBitmap", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHDrawBitmap(IntPtr hdl, short x, short y, ushort width, ushort height, uint format, tagBitmapSource pbmpsrc); [DllImport(zkdll, EntryPoint = "JHDrawLine", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHDrawLine(IntPtr hdl, short x1, short y1, short x2, short y2); [DllImport(zkdll, EntryPoint = "JHMountTransportLayer", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHMountTransportLayer(IntPtr hdl, IntPtr ptl, IntPtr argstruct); [DllImport(commdll, EntryPoint = "JHCommInit", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHCommInit(); [DllImport(commdll, EntryPoint = "JHCommDeinit", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHCommDeinit(); [DllImport(commdll, EntryPoint = "JHCommGetTransportlayer", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHCommGetTransportlayer(ref IntPtr ptransportlayer, int dev); [DllImport(commdll, EntryPoint = "JHCommReleaseArgStruct", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHCommReleaseArgStruct(IntPtr pargs); [DllImport(commdll, EntryPoint = "JHCommGetNetArgStruct", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHCommGetNetArgStruct(ref IntPtr pargs, string ipordomain, ushort port, uint timeout); [DllImport(commdll, EntryPoint = "JHCommGetSerialportArgStruct", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHCommGetSerialportArgStruct(ref IntPtr pargs, string name, uint baudrate, byte databits, byte parity, byte stopbits, uint timeout); [DllImport(zkdll, EntryPoint = "JHSetCurPenColor", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHSetCurPenColor(IntPtr hdl, UInt32 x1); [DllImport(zkdll, EntryPoint = "JHFillRect", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int JHFillRect(IntPtr hdl, short x, short y, ushort width, ushort height); } }