/// <summary> /// タブレットのXYZ座標の範囲取得 /// </summary> /// <param name="dimention"></param> /// <returns></returns> public static WintabAxis GetTabletAxis(EAxisDimension dimention) { WintabAxis axis = new WintabAxis(); IntPtr pAxis = WintabMemoryUtility.AllocUnmanagedBuffer(axis); try { uint sz = WintabFunctions.WTInfoA( (uint)EWTICategoryIndex.WTI_DEVICES, (uint)dimention, pAxis); if (sz != 0) { axis = WintabMemoryUtility.MarshalUnmanagedBuffer <WintabAxis>(pAxis, sz); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("GetTabletAxis : " + ex.Message); throw ex; } finally { WintabMemoryUtility.FreeUnmanagedBuffer(pAxis); } return(axis); }
/// <summary> /// Returns the WintabAxis object for specified device and dimension. /// </summary> /// <param name="devIndex_I">Device index (-1 = virtual device)</param> /// <param name="dim_I">Dimension: AXIS_X, AXIS_Y or AXIS_Z</param> /// <returns></returns> public static WintabAxis GetDeviceAxis(Int32 devIndex_I, EAxisDimension dim_I) { WintabAxis axis = new WintabAxis(); IntPtr buf = WMemUtils.AllocUnmanagedBuf(axis); try { int size = (int)WNativeMethods.WTInfo( (uint)(EWTICategoryIndex.WTI_DEVICES + devIndex_I), (uint)dim_I, buf); // If size == 0, then returns a zeroed struct. axis = WMemUtils.MarshalUnmanagedBuf <WintabAxis>(buf, size); } catch (Exception ex) { throw new Exception("FAILED GetDeviceAxis: " + ex.ToString()); } WMemUtils.FreeUnmanagedBuf(buf); return(axis); }
/// <summary> /// Return the WintabAxis object for the specified dimension. /// </summary> /// <param name="dimension_I">Dimension to fetch (eg: x, y)</param> /// <returns></returns> public static WintabAxis GetTabletAxis(EAxisDimension dimension_I) { WintabAxis axis = new WintabAxis(); IntPtr buf = CMemUtils.AllocUnmanagedBuf(axis); try { int size = (int)CWintabFuncs.WTInfo( (uint)EWTICategoryIndex.WTI_DEVICES, (uint)dimension_I, buf); axis = CMemUtils.MarshalUnmanagedBuf <WintabAxis>(buf, size); } finally { CMemUtils.FreeUnmanagedBuf(buf); } return(axis); }
/// <summary> /// Returns the WintabAxis object for specified device and dimension. /// </summary> /// <param name="devIndex_I">Device index (-1 = virtual device)</param> /// <param name="dim_I">Dimension: AXIS_X, AXIS_Y or AXIS_Z</param> /// <returns></returns> public static WintabAxis GetDeviceAxis(Int32 devIndex_I, EAxisDimension dim_I) { WintabAxis axis = new WintabAxis(); IntPtr buf = CMemUtils.AllocUnmanagedBuf(axis); try { int size = (int)CWintabFuncs.WTInfo( (uint)(EWTICategoryIndex.WTI_DEVICES + devIndex_I), (uint)dim_I, buf); // If size == 0, then returns a zeroed struct. axis = CMemUtils.MarshalUnmanagedBuf <WintabAxis>(buf, size); } finally { CMemUtils.FreeUnmanagedBuf(buf); } return(axis); }
/// <summary> /// Return the WintabAxis object for the specified dimension. /// </summary> /// <param name="dimension_I">Dimension to fetch (eg: x, y)</param> /// <returns></returns> public static WintabAxis GetTabletAxis(EAxisDimension dimension_I) { WintabAxis axis = new WintabAxis(); IntPtr buf = CMemUtils.AllocUnmanagedBuf(axis); try { int size = (int)CWintabFuncs.WTInfoA( (uint)EWTICategoryIndex.WTI_DEVICES, (uint)dimension_I, buf); axis = CMemUtils.MarshalUnmanagedBuf <WintabAxis>(buf, size); } catch (Exception ex) { MessageBox.Show("FAILED GetMaxPressure: " + ex.ToString()); } CMemUtils.FreeUnmanagedBuf(buf); return(axis); }
/// <summary> /// Return the WintabAxis object for the specified dimension. /// </summary> /// <param name="dimension_I">Dimension to fetch (eg: x, y)</param> /// <returns></returns> public static WintabAxis GetTabletAxis(EAxisDimension dimension_I) { WintabAxis axis = new WintabAxis(); IntPtr buf = CMemUtils.AllocUnmanagedBuf(axis); try { int size = (int)CWintabFuncs.WTInfoA( (uint)EWTICategoryIndex.WTI_DEVICES, (uint)dimension_I, buf); axis = CMemUtils.MarshalUnmanagedBuf<WintabAxis>(buf, size); } catch (Exception ex) { MessageBox.Show("FAILED GetMaxPressure: " + ex.ToString()); } CMemUtils.FreeUnmanagedBuf(buf); return axis; }
/// <summary> /// Returns the WintabAxis object for specified device and dimension. /// </summary> /// <param name="devIndex_I">Device index (-1 = virtual device)</param> /// <param name="dim_I">Dimension: AXIS_X, AXIS_Y or AXIS_Z</param> /// <returns></returns> public static WintabAxis GetDeviceAxis(Int32 devIndex_I, EAxisDimension dim_I) { WintabAxis axis = new WintabAxis(); IntPtr buf = CMemUtils.AllocUnmanagedBuf(axis); try { int size = (int)CWintabFuncs.WTInfoA( (uint)(EWTICategoryIndex.WTI_DEVICES + devIndex_I), (uint)dim_I, buf); // If size == 0, then returns a zeroed struct. axis = CMemUtils.MarshalUnmanagedBuf<WintabAxis>(buf, size); } catch (Exception ex) { MessageBox.Show("FAILED GetDeviceAxis: " + ex.ToString()); } CMemUtils.FreeUnmanagedBuf(buf); return axis; }