LedControl_bak.cs 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Runtime.InteropServices;
  7. namespace HNWD.LatticeScreen
  8. {
  9. internal class LedControl_bak
  10. {
  11. public const int JR_OK = 0;
  12. //public const string zkdll = "..\\..\\..\\..\\Dll\\windows\\jinhanzk.dll";
  13. //public const string commdll = "..\\..\\..\\..\\Dll\\windows\\jinhancomm.dll";
  14. public const string zkdll = "jinhanzk.dll";
  15. public const string commdll = "jinhancomm.dll";
  16. [DllImport(zkdll, EntryPoint = "JHCreateInst", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  17. public static extern int JHCreateInst(ref IntPtr hdl, ushort serverid);
  18. [DllImport(zkdll, EntryPoint = "JHDeleteInst", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  19. public static extern int JHDeleteInst(IntPtr hdl);
  20. [DllImport(zkdll, EntryPoint = "JHDrawText", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  21. public static extern int JHDrawText(IntPtr hdl, short x, short y, ushort width, ushort height, uint format, string ptext);
  22. [DllImport(zkdll, EntryPoint = "JHDrawMultPixel", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  23. public static extern int JHDrawMultPixel(IntPtr hdl, ushort[] pdat, ushort poscnt);
  24. [DllImport(zkdll, EntryPoint = "JHErase", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  25. public static extern int JHErase(IntPtr hdl);
  26. [DllImport(zkdll, EntryPoint = "JHScrollRight", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  27. public static extern int JHScrollRight(IntPtr hdl, short x, short y, ushort width, ushort height);
  28. [DllImport(zkdll, EntryPoint = "JHScrollLeft", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  29. public static extern int JHScrollLeft(IntPtr hdl, short x, short y, ushort width, ushort height);
  30. [DllImport(zkdll, EntryPoint = "JHDrawBitmap", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  31. public static extern int JHDrawBitmap(IntPtr hdl, short x, short y, ushort width, ushort height, uint format, tagBitmapSource pbmpsrc);
  32. [DllImport(zkdll, EntryPoint = "JHDrawLine", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  33. public static extern int JHDrawLine(IntPtr hdl, short x1, short y1, short x2, short y2);
  34. [DllImport(zkdll, EntryPoint = "JHMountTransportLayer", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  35. public static extern int JHMountTransportLayer(IntPtr hdl, IntPtr ptl, IntPtr argstruct);
  36. [DllImport(commdll, EntryPoint = "JHCommInit", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  37. public static extern int JHCommInit();
  38. [DllImport(commdll, EntryPoint = "JHCommDeinit", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  39. public static extern int JHCommDeinit();
  40. [DllImport(commdll, EntryPoint = "JHCommGetTransportlayer", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  41. public static extern int JHCommGetTransportlayer(ref IntPtr ptransportlayer, int dev);
  42. [DllImport(commdll, EntryPoint = "JHCommReleaseArgStruct", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  43. public static extern int JHCommReleaseArgStruct(IntPtr pargs);
  44. [DllImport(commdll, EntryPoint = "JHCommGetNetArgStruct", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  45. public static extern int JHCommGetNetArgStruct(ref IntPtr pargs, string ipordomain, ushort port, uint timeout);
  46. [DllImport(commdll, EntryPoint = "JHCommGetSerialportArgStruct", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  47. public static extern int JHCommGetSerialportArgStruct(ref IntPtr pargs, string name, uint baudrate, byte databits, byte parity, byte stopbits, uint timeout);
  48. [DllImport(zkdll, EntryPoint = "JHSetCurPenColor", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  49. public static extern int JHSetCurPenColor(IntPtr hdl, UInt32 x1);
  50. [DllImport(zkdll, EntryPoint = "JHFillRect", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  51. public static extern int JHFillRect(IntPtr hdl, short x, short y, ushort width, ushort height);
  52. }
  53. }