Stroke 类

定义

表示单个笔划墨迹。Represents a single ink stroke.

public ref class Stroke : System::ComponentModel::INotifyPropertyChanged
public class Stroke : System.ComponentModel.INotifyPropertyChanged
type Stroke = class
    interface INotifyPropertyChanged
Public Class Stroke
Implements INotifyPropertyChanged
继承
Stroke
实现

注解

Stroke 是从指针设备(如 tablet 笔或鼠标)收集的数据对象。A Stroke is the data object that is collected from a pointing device, such as a tablet pen or a mouse. 可以通过编程方式创建和操作 Stroke,并可在启用了墨的元素(如 InkCanvas)上直观地表示。The Stroke can be created and manipulated programmatically, and can be represented visually on an ink-enabled element, such as the InkCanvas. 一个 Stroke,其中包含有关其位置和外观的信息。A Stroke contains information about both its position and appearance. StylusPoints 属性是指定 Stroke位置的 StylusPoint 对象的集合。The StylusPoints property is a collection of StylusPoint objects that specifies the position of the Stroke. DrawingAttributes 属性指定笔画的外观。The DrawingAttributes property specifies a stroke's appearance.

构造函数

Stroke(StylusPointCollection)

初始化 Stroke 类的新实例。Initializes a new instance of the Stroke class.

Stroke(StylusPointCollection, DrawingAttributes)

初始化 Stroke 类的新实例。Initializes a new instance of the Stroke class.

属性

DrawingAttributes

获取或设置 DrawingAttributes 对象的 StrokeGets or sets the DrawingAttributes for the Stroke object.

StylusPoints

返回 Stroke 的触笔接触点。Returns the stylus points of the Stroke.

方法

AddPropertyData(Guid, Object)

将一个自定义属性添加到 Stroke 对象中。Adds a custom property to the Stroke object.

Clone()

返回现有 Stroke 对象的深层副本。Returns a deep copy of the existing Stroke object.

ContainsPropertyData(Guid)

返回一个指示 Stroke 对象是否包含指定的自定义属性的值。Returns a value that indicates whether the Stroke object contains the specified custom property.

Draw(DrawingContext)

根据指定的 Stroke 呈现 DrawingContext 对象。Renders the Stroke object based upon the specified DrawingContext.

Draw(DrawingContext, DrawingAttributes)

根据指定的 StrokeDrawingContext 呈现 DrawingAttributes 对象。Renders the Stroke object based upon the specified DrawingContext and DrawingAttributes.

DrawCore(DrawingContext, DrawingAttributes)

使用指定的 Stroke 在指定的 DrawingContext 上呈现 DrawingAttributesRenders the Stroke on the specified DrawingContext using the specified DrawingAttributes.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetBezierStylusPoints()

StrokeFitToCurve 时,返回 true 使用的触笔接触点。Returns the stylus points the Stroke uses when FitToCurve is true.

GetBounds()

检索 Stroke 对象的边界框。Retrieves the bounding box for the Stroke object.

GetClipResult(IEnumerable<Point>)

返回当前 Stroke 的位于指定边界内的线段。Returns segments of the current Stroke that are within the specified bounds.

GetClipResult(Rect)

返回位于指定矩形内的当前 Stroke 的线段。Returns segments of the current Stroke that are within the specified rectangle.

GetEraseResult(IEnumerable<Point>)

返回当前 Stroke 的位于指定边界外的线段。Returns segments of the current Stroke that are outside the specified bounds.

GetEraseResult(IEnumerable<Point>, StylusShape)

在指定的路径使用指定的 Stroke 分割当前的 StylusShape 后,返回其线段。Returns the segments of the current Stroke after it is dissected by the designated path using the specified StylusShape.

GetEraseResult(Rect)

返回位于当前 Stroke 的指定矩形外的线段。Returns segments of the current Stroke that are outside the specified rectangle.

GetGeometry()

获取当前 GeometryStrokeGets the Geometry of the current Stroke.

GetGeometry(DrawingAttributes)

使用指定的 Geometry 获取当前 StrokeDrawingAttributesGets the Geometry of the current Stroke using the specified DrawingAttributes.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetPropertyData(Guid)

检索指定 GUID 的属性数据。Retrieves the property data for the specified GUID.

GetPropertyDataIds()

检索与 Stroke 对象关联的任何自定义属性的 GUID。Retrieves the GUIDs of any custom properties associated with the Stroke object.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
HitTest(IEnumerable<Point>, Int32)

返回一个指示当前 Stroke 是否位于指定边界内的值。Returns a value that indicates whether the current Stroke is within the specified bounds.

HitTest(IEnumerable<Point>, StylusShape)

返回指定的路径是否使用指定的 StrokeStylusShape 相交。Returns whether the specified path intersects the Stroke using the specified StylusShape.

HitTest(Point)

返回一个指示当前 Stroke 是否与指定点相交的值。Returns a value that indicates whether current Stroke intersects the specified point.

HitTest(Point, Double)

返回一个指示当前 Stroke 是否与指定区域相交的值。Returns a value that indicates whether current Stroke intersects the specified area.

HitTest(Rect, Int32)

返回一个值,该值指示 Stroke 是否在指定矩形的边界内。Returns a value that indicates whether the Stroke is within the bounds of the specified rectangle.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnDrawingAttributesChanged(PropertyDataChangedEventArgs)

允许派生类修改 DrawingAttributesChanged 事件的默认行为。Allows derived classes to modify the default behavior of the DrawingAttributesChanged event.

OnDrawingAttributesReplaced(DrawingAttributesReplacedEventArgs)

允许派生类修改 DrawingAttributesReplaced 事件的默认行为。Allows derived classes to modify the default behavior of the DrawingAttributesReplaced event.

OnInvalidated(EventArgs)

引发 Invalidated 事件。Raises the Invalidated event.

OnPropertyChanged(PropertyChangedEventArgs)

当任何 Stroke 属性更改时发生。Occurs when any Stroke property changes.

OnPropertyDataChanged(PropertyDataChangedEventArgs)

允许派生类修改 PropertyDataChanged 事件的默认行为。Allows derived classes to modify the default behavior of the PropertyDataChanged event.

OnStylusPointsChanged(EventArgs)

引发 StylusPointsChanged 事件。Raises the StylusPointsChanged event.

OnStylusPointsReplaced(StylusPointsReplacedEventArgs)

引发 StylusPointsReplaced 事件。Raises the StylusPointsReplaced event.

RemovePropertyData(Guid)

Stroke 对象中删除自定义属性。Deletes a custom property from the Stroke object.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Transform(Matrix, Boolean)

根据指定的 Matrix 对象执行变换。Performs a transformation based upon the specified Matrix object.

事件

DrawingAttributesChanged

在与 DrawingAttributes 对象关联的 Stroke 更改后发生。Occurs when the DrawingAttributes associated with the Stroke object change.

DrawingAttributesReplaced

Stroke 对象的绘制特性被替换时发生。Occurs when the drawing attributes of a Stroke object are replaced.

Invalidated

Stroke 的外观更改时发生。Occurs when the appearance of the Stroke changes.

PropertyDataChanged

Stroke 对象的自定义属性更改时发生。Occurs when the custom properties on a Stroke object changes.

StylusPointsChanged

StylusPoints 属性更改时发生。Occurs when the StylusPoints property changes.

StylusPointsReplaced

在对 StylusPoints 属性分配新的 StylusPointCollection 时发生。Occurs when the StylusPoints property is assigned a new StylusPointCollection.

显式接口实现

INotifyPropertyChanged.PropertyChanged

在任何 Stroke 属性的值更改时发生。Occurs when the value of any Stroke property has changed.

适用于

另请参阅