TabletPropertyMetrics.Minimum 字段

指定 Tablet 为此属性报告的最小值(采用逻辑单位)。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Minimum As Integer
用法
Dim instance As TabletPropertyMetrics
Dim value As Integer

value = instance.Minimum

instance.Minimum = value
public int Minimum
public:
int Minimum
public int Minimum
public var Minimum : int

字段值

类型:System.Int32
Tablet 为此属性报告的最小值。

备注

例如,报告介于 0 和 9000 之间的 x 值的 Tablet 具有逻辑最小值 0。

示例

在此示例中,修改 InkOverlay 对象的所有选定 Stroke 对象,以便该笔画的前半部分的每个点包含允许的最小 NormalPressure 数据包值。

使用 GetPacketValuesByProperty 方法获取 Stroke 对象的前半部分的 NormalPressure 数据包值。然后,使用 SetPacketValuesByProperty 方法将这些值设置为最小允许值(通过 GetPacketDescriptionPropertyMetrics 方法获取),并将这些值重新应用于该笔画。

Try
    For Each S As Stroke In mInkOverlay.Selection
        ' get the PacketProperty.NormalPressure metrics for the stroke
        Dim metrics As TabletPropertyMetrics = S.GetPacketDescriptionPropertyMetrics(PacketProperty.NormalPressure)
        ' we want to get half of the NormalPressure values
        Dim halfWayPt As Integer = S.PacketCount / 2
        ' get the NormalPressure values for the first half of the packets
        Dim npValues() As Integer = S.GetPacketValuesByProperty(PacketProperty.NormalPressure, 0, halfWayPt)
        ' set the NormalPressure values to min
        For k As Integer = 0 To npValues.Length - 1
            npValues(k) = metrics.Minimum
        Next
        ' set the NormalPressure values for the first half of the packets
        S.SetPacketValuesByProperty(PacketProperty.NormalPressure, 0, halfWayPt, npValues)
    Next
Catch ex As ArgumentException
    ' This exception will be raised if PacketProperty.NormalPressure is not supported
    ' This will be the case if creating strokes with a mouse
End Try
try
{
    foreach (Stroke S in mInkOverlay.Selection)
    {
        // get the PacketProperty.NormalPressure metrics for the stroke
        TabletPropertyMetrics metrics = S.GetPacketDescriptionPropertyMetrics(PacketProperty.NormalPressure);
        // we want to get half of the NormalPressure values
        int halfWayPt = S.PacketCount / 2;
        // get the NormalPressure values for the first half of the packets
        int[] npValues = S.GetPacketValuesByProperty(PacketProperty.NormalPressure, 0, halfWayPt);
        // set the NormalPressure values to min
        for (int k = 0; k < npValues.Length; k++)
        {
            npValues[k] = metrics.Minimum;
        }
        // set the NormalPressure values for the first half of the packets
        S.SetPacketValuesByProperty(PacketProperty.NormalPressure, 0, halfWayPt, npValues);
    }
}
catch (ArgumentException)
{
    // This exception will be raised if PacketProperty.NormalPressure is not supported
    // This will be the case if creating strokes with a mouse
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

TabletPropertyMetrics 结构

TabletPropertyMetrics 成员

Microsoft.Ink 命名空间

TabletPropertyMetrics.Maximum

Tablet.GetPropertyMetrics