Stroke Class

Represents a single ink stroke.

System::Object
  System.Windows.Ink::Stroke

Namespace:  System.Windows.Ink
Assembly:  PresentationCore (in PresentationCore.dll)

public ref class Stroke : INotifyPropertyChanged

The Stroke type exposes the following members.

  NameDescription
Public methodStroke(StylusPointCollection)Initializes a new instance of the Stroke class.
Public methodStroke(StylusPointCollection, DrawingAttributes)Initializes a new instance of the Stroke class.
Top

  NameDescription
Public propertyDrawingAttributesGets or sets the DrawingAttributes for the Stroke object.
Public propertyStylusPointsReturns the stylus points of the Stroke.
Top

  NameDescription
Public methodAddPropertyDataAdds a custom property to the Stroke object.
Public methodCloneReturns a deep copy of the existing Stroke object.
Public methodContainsPropertyDataReturns a value that indicates whether the Stroke object contains the specified custom property.
Public methodDraw(DrawingContext)Renders the Stroke object based upon the specified DrawingContext.
Public methodDraw(DrawingContext, DrawingAttributes)Renders the Stroke object based upon the specified DrawingContext and DrawingAttributes.
Protected methodDrawCoreRenders the Stroke on the specified DrawingContext using the specified DrawingAttributes.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetBezierStylusPointsReturns the stylus points the Stroke uses when FitToCurve is true.
Public methodGetBoundsRetrieves the bounding box for the Stroke object.
Public methodGetClipResult(IEnumerable<Point>)Returns segments of the current Stroke that are within the specified bounds.
Public methodGetClipResult(Rect)Returns segments of the current Stroke that are within the specified rectangle.
Public methodGetEraseResult(IEnumerable<Point>)Returns segments of the current Stroke that are outside the specified bounds.
Public methodGetEraseResult(Rect)Returns segments of the current Stroke that are outside the specified rectangle.
Public methodGetEraseResult(IEnumerable<Point>, StylusShape)Returns the segments of the current Stroke after it is dissected by the designated path using the specified StylusShape.
Public methodGetGeometry()Gets the Geometry of the current Stroke.
Public methodGetGeometry(DrawingAttributes)Gets the Geometry of the current Stroke using the specified DrawingAttributes.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetPropertyDataRetrieves the property data for the specified GUID.
Public methodGetPropertyDataIdsRetrieves the GUIDs of any custom properties associated with the Stroke object.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodHitTest(Point)Returns a value that indicates whether current Stroke intersects the specified point.
Public methodHitTest(IEnumerable<Point>, Int32)Returns a value that indicates whether the current Stroke is within the specified bounds.
Public methodHitTest(IEnumerable<Point>, StylusShape)Returns whether the specified path intersects the Stroke using the specified StylusShape.
Public methodHitTest(Point, Double)Returns a value that indicates whether current Stroke intersects the specified area.
Public methodHitTest(Rect, Int32)Returns a value that indicates whether the Stroke is within the bounds of the specified rectangle.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnDrawingAttributesChangedAllows derived classes to modify the default behavior of the DrawingAttributesChanged event.
Protected methodOnDrawingAttributesReplacedAllows derived classes to modify the default behavior of the DrawingAttributesReplaced event.
Protected methodOnInvalidatedRaises the Invalidated event.
Protected methodOnPropertyChangedOccurs when any Stroke property changes.
Protected methodOnPropertyDataChangedAllows derived classes to modify the default behavior of the PropertyDataChanged event.
Protected methodOnStylusPointsChangedRaises the StylusPointsChanged event.
Protected methodOnStylusPointsReplacedRaises the StylusPointsReplaced event.
Public methodRemovePropertyDataDeletes a custom property from the Stroke object.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodTransformPerforms a transformation based upon the specified Matrix object.
Top

  NameDescription
Public eventDrawingAttributesChangedOccurs when the DrawingAttributes associated with the Stroke object change.
Public eventDrawingAttributesReplacedOccurs when the drawing attributes of a Stroke object are replaced.
Public eventInvalidatedOccurs when the appearance of the Stroke changes.
Public eventPropertyDataChangedOccurs when the custom properties on a Stroke object changes.
Public eventStylusPointsChangedOccurs when the StylusPoints property changes.
Public eventStylusPointsReplacedOccurs when the StylusPoints property is assigned a new StylusPointCollection.
Top

  NameDescription
Explicit interface implemetationPrivate eventINotifyPropertyChanged::PropertyChangedInfrastructure. Occurs when the value of any Stroke property has changed.
Top

A Stroke is the data object that is collected from a pointing device, such as a tablet pen or a mouse. The Stroke can be created and manipulated programmatically, and can be represented visually on an ink-enabled element, such as the InkCanvas. A Stroke contains information about both its position and appearance. The StylusPoints property is a collection of StylusPoint objects that specifies the position of the Stroke. The DrawingAttributes property specifies a stroke's appearance.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft