Condividi tramite


Campo TabletPropertyMetrics.Maximum

Aggiornamento: novembre 2007

Specifica il valore massimo, in unità logiche, segnalato dalla tavoletta per questa proprietà.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Sintassi

'Dichiarazione
Public Maximum As Integer
'Utilizzo
Dim instance As TabletPropertyMetrics
Dim value As Integer

value = instance.Maximum

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

Valore di campo

Tipo: System.Int32
Valore massimo segnalato dalla tavoletta per questa proprietà.

Note

Ad esempio, una tavoletta che segnala valori X da 0 a 9000 dispone di un valore logico massimo di 9000.

Esempi

In questo esempio ogni oggetto Stroke selezionato di un oggetto InkOverlay viene modificato in modo che ogni punto della seconda metà del tratto contenga il valore massimo consentito del pacchetto NormalPressure.

Tramite il metodo GetPacketValuesByProperty si ottengono i valori del pacchetto NormalPressure per la seconda metà dell'oggetto Stroke. I valori vengono quindi impostati sul valore massimo consentito (ottenuto tramite il metodo GetPacketDescriptionPropertyMetrics) e riapplicati al tratto tramite il metodo SetPacketValuesByProperty.

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)
        ' get the starting point
        Dim startPt As Integer = S.PacketCount / 2
        ' get the NormalPressure values starting at startPt
        Dim npValues() As Integer = S.GetPacketValuesByProperty(PacketProperty.NormalPressure, startPt)
        ' set the NormalPressure values to max
        For k As Integer = 0 To npValues.Length - 1
            npValues(k) = metrics.Maximum
        Next
        ' set the NormalPressure values starting at startPt
        S.SetPacketValuesByProperty(PacketProperty.NormalPressure, startPt, 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);
        // get the starting point
        int startPt = S.PacketCount / 2;
        // get the NormalPressure values starting at startPt
        int[] npValues = S.GetPacketValuesByProperty(PacketProperty.NormalPressure, startPt);
        // set the NormalPressure values to max
        for (int k = 0; k < npValues.Length; k++)
        {
            npValues[k] = metrics.Maximum;
        }
        // set the NormalPressure values starting at startPt
        S.SetPacketValuesByProperty(PacketProperty.NormalPressure, startPt, 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
}

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

TabletPropertyMetrics Struttura

Membri TabletPropertyMetrics

Spazio dei nomi Microsoft.Ink

TabletPropertyMetrics.Minimum

Tablet.GetPropertyMetrics