Пример #1
0
            /// <summary>
            /// Converts the native TabletDeviceStatesListNative structure into an array of TabletState structures.
            /// </summary>
            /// <param name="deviceStatesNative">The retrieved TabletDeviceStatesListNative structure.</param>
            /// <returns>Returns an array of TabletState structures.</returns>
            public static MLInput.TabletState[] DeviceStatesToArray(TabletDeviceStatesListNative deviceStatesNative)
            {
                MLInput.TabletState[] deviceStates = new MLInput.TabletState[deviceStatesNative.Count];
                for (int i = 0; i < (int)deviceStatesNative.Count; i++)
                {
                    deviceStates[i] = Marshal.PtrToStructure <NativeBindings.TabletDeviceStateNative>(deviceStatesNative.Data + (i * Marshal.SizeOf(typeof(NativeBindings.TabletDeviceStateNative)))).Data;
                }

                return(deviceStates);
            }
Пример #2
0
 public static extern MLResult.Code MLInputReleaseTabletDeviceStates(ulong handle, ref TabletDeviceStatesListNative tablet_device_states);
Пример #3
0
 public static extern MLResult.Code MLInputGetTabletDeviceStates(ulong handle, byte tablet_device_id, ref TabletDeviceStatesListNative out_tablet_device_states);