指定手寫板針對此屬性所回報的最大值 (以邏輯單位計算)。
命名空間: Microsoft.Ink
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public Maximum As Integer
'用途
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
欄位值
型別:System.Int32
手寫板針對此屬性所回報的最大值。
備註
例如,若手寫板回報的 X 值為 0 到 9000,其邏輯最大值即為 9000。
範例
在這個範例中,InkOverlay 物件的每個已選取 Stroke 物件都會經過修改,使筆劃後半部的每個點都會包含允許的最大 NormalPressure 封包值。
若使用 GetPacketValuesByProperty 方法,則會取得 Stroke 物件後半部的 NormalPressure 封包值。接著這些值會設定為允許的最大值 (透過 GetPacketDescriptionPropertyMetrics 方法取得),並且使用 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
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0