Adding persistent settings and marquee separator.
2 using System.Collections.Generic;
5 using System.Threading.Tasks;
7 using System.Runtime.InteropServices;
9 namespace SharpDisplayManager
17 iDevice = IntPtr.Zero;
23 if (iDevice == IntPtr.Zero)
25 iDevice = MiniDisplayOpen();
27 return iDevice != IntPtr.Zero;
32 MiniDisplayClose(iDevice);
33 iDevice = IntPtr.Zero;
38 return iDevice != IntPtr.Zero;
43 MiniDisplayClear(iDevice);
48 MiniDisplayFill(iDevice);
51 public void SwapBuffers()
53 MiniDisplaySwapBuffers(iDevice);
56 public int MaxBrightness()
58 return MiniDisplayMaxBrightness(iDevice);
61 public int MinBrightness()
63 return MiniDisplayMinBrightness(iDevice);
66 public void SetBrightness(int aBrightness)
68 if (!IsOpen()) return;
70 MiniDisplaySetBrightness(iDevice, aBrightness);
73 public int WidthInPixels()
75 return MiniDisplayWidthInPixels(iDevice);
78 public int HeightInPixels()
80 return MiniDisplayHeightInPixels(iDevice);
83 public void SetPixel(int aX, int aY, int aValue)
85 MiniDisplaySetPixel(iDevice,aX,aY,aValue);
90 //Our display device handle
93 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
94 public static extern IntPtr MiniDisplayOpen();
96 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
97 public static extern void MiniDisplayClose(IntPtr aDevice);
99 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
100 public static extern void MiniDisplayClear(IntPtr aDevice);
102 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
103 public static extern void MiniDisplayFill(IntPtr aDevice);
105 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
106 public static extern void MiniDisplaySwapBuffers(IntPtr aDevice);
108 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
109 public static extern void MiniDisplaySetBrightness(IntPtr aDevice, int aBrightness);
111 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
112 public static extern int MiniDisplayMinBrightness(IntPtr aDevice);
114 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
115 public static extern int MiniDisplayMaxBrightness(IntPtr aDevice);
117 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
118 public static extern int MiniDisplayWidthInPixels(IntPtr aDevice);
120 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
121 public static extern int MiniDisplayHeightInPixels(IntPtr aDevice);
123 [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
124 public static extern int MiniDisplaySetPixel(IntPtr aDevice, int aX, int aY, int aValue);