Ink.DeleteStroke - метод
Обновлен: Ноябрь 2007
Deletes a Stroke object from the Ink object.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public Sub DeleteStroke ( _
stroke As Stroke _
)
'Применение
Dim instance As Ink
Dim stroke As Stroke
instance.DeleteStroke(stroke)
public void DeleteStroke(
Stroke stroke
)
public:
void DeleteStroke(
Stroke^ stroke
)
public void DeleteStroke(
Stroke stroke
)
public function DeleteStroke(
stroke : Stroke
)
Параметры
- stroke
Тип: Microsoft.Ink.Stroke
The Stroke object to delete.
Заметки
This method deletes only a single Stroke object. To delete a Strokes collection, call the DeleteStrokes method.
This method can result in an error if called while the user is actively laying down ink.
Примеры
This example creates a sample method that uses a foreach loop to iterate through the Stroke objects contained in an Ink object. It then deletes any Stroke object that has more points than maxPointCount.
Private Sub DeleteStrokesByPointCount(ByVal theInk As Ink, ByVal maxPointCount As Integer)
' Access to the Strokes property returns a copy of the Strokes object.
' This copy must be implicitly (via using statement) or explicitly
' disposed of in order to avoid a memory leak.
Using currentStrokes As Strokes = theInk.Strokes
For Each S As Stroke In currentStrokes
If S.PacketCount > maxPointCount Then
theInk.DeleteStroke(S)
End If
Next
End Using
End Sub
private void DeleteStrokesByPointCount(Ink theInk, int maxPointCount)
{
// Access to the Strokes property returns a copy of the Strokes object.
// This copy must be implicitly (via using statement) or explicitly
// disposed of in order to avoid a memory leak.
using (Strokes currentStrokes = theInk.Strokes)
{
foreach (Stroke S in currentStrokes)
{
if (S.PacketCount > maxPointCount)
{
theInk.DeleteStroke(S);
}
}
}
}
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0