StrokeCollection Class
Represents a collection of Stroke objects.
System.Collections.ObjectModel::Collection<Stroke>
System.Windows.Ink::StrokeCollection
Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
[TypeConverterAttribute(typeof(StrokeCollectionConverter))] public ref class StrokeCollection : public Collection<Stroke^>, INotifyPropertyChanged, INotifyCollectionChanged
<object>isfString</object>
<object StrokeCollection="isfString"/>
XAML Values
Term | Definition |
|---|---|
isfString | A string that represents the stroke in base-64, encoded Ink Serialized Format (ISF). |
The StrokeCollection type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | StrokeCollection() | Initializes a new instance of the StrokeCollection class. |
![]() | StrokeCollection(IEnumerable<Stroke>) | Initializes a new instance of the StrokeCollection class that contains the specified strokes. |
![]() | StrokeCollection(Stream) | Initializes a StrokeCollection from the specified Stream of Ink Serialized Format (ISF). |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of elements actually contained in the Collection<T>. (Inherited from Collection<T>.) |
![]() | Item | Gets or sets the element at the specified index. (Inherited from Collection<T>.) |
![]() | Items | Gets a IList<T> wrapper around the Collection<T>. (Inherited from Collection<T>.) |
| Name | Description | |
|---|---|---|
![]() | Add(T) | Adds an object to the end of the Collection<T>. (Inherited from Collection<T>.) |
![]() | Add(StrokeCollection) | Adds the specified strokes to the StrokeCollection. |
![]() | AddPropertyData | Adds a custom property to the StrokeCollection. |
![]() | Clear | Removes all elements from the Collection<T>. (Inherited from Collection<T>.) |
![]() | ClearItems | Infrastructure. Clears all strokes from the StrokeCollection. (Overrides Collection<T>::ClearItems().) |
![]() | Clip(IEnumerable<Point>) | Removes all strokes in the StrokeCollection that are outside the bounds of the specified Point array. |
![]() | Clip(Rect) | Replaces all strokes that are clipped by the specified rectangle with new strokes that do not extend beyond the specified rectangle. |
![]() | Clone | Copies the StrokeCollection. |
![]() | Contains | Determines whether an element is in the Collection<T>. (Inherited from Collection<T>.) |
![]() | ContainsPropertyData | Returns whether the specified custom property identifier is in the StrokeCollection. |
![]() | CopyTo | Copies the entire Collection<T> to a compatible one-dimensional Array, starting at the specified index of the target array. (Inherited from Collection<T>.) |
![]() | Draw | Draws the strokes in the StrokeCollection. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Erase(IEnumerable<Point>) | Removes the ink that is within the bounds of the specified area. |
![]() | Erase(Rect) | Replaces all strokes that are clipped by the specified rectangle with new strokes that do not enter the bounds of the specified rectangle. |
![]() | Erase(IEnumerable<Point>, StylusShape) | Replaces all strokes that are clipped by the region created by the specified StylusShape along the specified path with new Strokes that are not clipped by the region. |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetBounds | Returns the bounds of the strokes in the collection. |
![]() | GetEnumerator | Returns an enumerator that iterates through the Collection<T>. (Inherited from Collection<T>.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetIncrementalLassoHitTester | Creates an IncrementalLassoHitTester that hit tests the StrokeCollection with a lasso (freehand) path. |
![]() | GetIncrementalStrokeHitTester | Creates an IncrementalStrokeHitTester that hit tests the StrokeCollection with an erasing path. |
![]() | GetPropertyData | Returns the value of the custom property associated with the specified Guid. |
![]() | GetPropertyDataIds | Returns the GUIDs of any custom properties associated with the StrokeCollection. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | HitTest(Point) | Returns a collection of strokes that intersect the specified point. |
![]() | HitTest(IEnumerable<Point>, Int32) | Returns a collection of strokes that have at least the specified percentage of length within the specified area. |
![]() | HitTest(IEnumerable<Point>, StylusShape) | Returns a collection of strokes that intersect with the specified path. |
![]() | HitTest(Point, Double) | Returns a collection of strokes that intersect the specified area. |
![]() | HitTest(Rect, Int32) | Returns a collection of strokes that have at least the specified percentage of length within the specified rectangle. |
![]() | IndexOf | Returns the index of the specified Stroke in the StrokeCollection. |
![]() | Insert | Inserts an element into the Collection<T> at the specified index. (Inherited from Collection<T>.) |
![]() | InsertItem | Infrastructure. Inserts a stroke into the StrokeCollection at the specified index. (Overrides Collection<T>::InsertItem(Int32, T).) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | OnPropertyChanged | Occurs when any StrokeCollection property changes. |
![]() | OnPropertyDataChanged | Raises the PropertyDataChanged event. |
![]() | OnStrokesChanged | Raises the StrokesChanged event. |
![]() | Remove(T) | Removes the first occurrence of a specific object from the Collection<T>. (Inherited from Collection<T>.) |
![]() | Remove(StrokeCollection) | Removes the specified strokes from the collection. |
![]() | RemoveAt | Removes the element at the specified index of the Collection<T>. (Inherited from Collection<T>.) |
![]() | RemoveItem | Infrastructure. Removes the stroke at the specified index from the StrokeCollection. (Overrides Collection<T>::RemoveItem(Int32).) |
![]() | RemovePropertyData | Removes the custom property associated with the specified Guid. |
![]() | Replace(Stroke, StrokeCollection) | Replaces the specified Stroke with the specified StrokeCollection. |
![]() | Replace(StrokeCollection, StrokeCollection) | Replaces the specified StrokeCollection with a new StrokeCollection. |
![]() | Save(Stream) | Saves the StrokeCollection to the specified Stream. |
![]() | Save(Stream, Boolean) | Saves the StrokeCollection to the specified Stream and compresses it, when specified. |
![]() | SetItem | Infrastructure. Replaces the stroke at the specified index. (Overrides Collection<T>::SetItem(Int32, T).) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | Transform | Modifies each of the StylusPoints and optionally the StylusTipTransform for each stroke in the StrokeCollection according to the specified Matrix. |
| Name | Description | |
|---|---|---|
![]() | PropertyDataChanged | Occurs when custom property is added or removed from the StrokeCollection. |
![]() | StrokesChanged | Occurs when a Stroke in the collection changes. |
| Name | Description | |
|---|---|---|
![]() ![]() | ICollection::CopyTo | Copies the elements of the ICollection to an Array, starting at a particular Array index. (Inherited from Collection<T>.) |
![]() ![]() | ICollection<T>::IsReadOnly | Gets a value indicating whether the ICollection<T> is read-only. (Inherited from Collection<T>.) |
![]() ![]() | ICollection::IsSynchronized | Gets a value indicating whether access to the ICollection is synchronized (thread safe). (Inherited from Collection<T>.) |
![]() ![]() | ICollection::SyncRoot | Gets an object that can be used to synchronize access to the ICollection. (Inherited from Collection<T>.) |
![]() ![]() | IEnumerable::GetEnumerator | Returns an enumerator that iterates through a collection. (Inherited from Collection<T>.) |
![]() ![]() | IList::Add | Adds an item to the IList. (Inherited from Collection<T>.) |
![]() ![]() | IList::Contains | Determines whether the IList contains a specific value. (Inherited from Collection<T>.) |
![]() ![]() | IList::IndexOf | Determines the index of a specific item in the IList. (Inherited from Collection<T>.) |
![]() ![]() | IList::Insert | Inserts an item into the IList at the specified index. (Inherited from Collection<T>.) |
![]() ![]() | IList::IsFixedSize | Gets a value indicating whether the IList has a fixed size. (Inherited from Collection<T>.) |
![]() ![]() | IList::IsReadOnly | Gets a value indicating whether the IList is read-only. (Inherited from Collection<T>.) |
![]() ![]() | IList::Item | Gets or sets the element at the specified index. (Inherited from Collection<T>.) |
![]() ![]() | IList::Remove | Removes the first occurrence of a specific object from the IList. (Inherited from Collection<T>.) |
![]() ![]() | INotifyCollectionChanged::CollectionChanged | Infrastructure. Occurs when the StrokeCollection changes. |
![]() ![]() | INotifyPropertyChanged::PropertyChanged | Infrastructure. Occurs when the value of any StrokeCollection property has changed. |
The StrokeCollection enables you to perform functions such as hit testing, clipping, and erasing strokes. The InkCanvas control performs many of these functions, but if you need more control than the InkCanvas provides, the StrokeCollection offers more options.
The following table lists where to learn about managing digital ink on a custom control.
To do this… | See this article |
|---|---|
Create a control that collects digital ink | |
Create a control that enables the user to select ink | |
Create a control that enables the user to point-erase ink |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.


