Share via


TabletPropertyMetrics.Minimum Field

Specifies the minimum value, in logical units, that the tablet reports for this property.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Minimum As Integer
'Usage
Dim instance As TabletPropertyMetrics 
Dim value As Integer 

value = instance.Minimum 

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

Field Value

Type: System.Int32
The minimum value that the tablet reports for this property.

Remarks

For example, a tablet reporting x-values from 0 to 9000 has a logical minimum of 0.

Examples

In this example, each selected Stroke object of an InkOverlay object is modified so that each point of the first half of the stroke contains the minimum allowed NormalPressure packet value.

Using the GetPacketValuesByProperty method, the NormalPressure packet values for the first half of the Stroke object are obtained. The values are then set to the minimum allowed (as obtained via the GetPacketDescriptionPropertyMetrics method), and reapplied to the stroke using the SetPacketValuesByProperty method.

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
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

TabletPropertyMetrics Structure

TabletPropertyMetrics Members

Microsoft.Ink Namespace

TabletPropertyMetrics.Maximum

Tablet.GetPropertyMetrics