StylusPointCollection.Reformat(StylusPointDescription) 方法

定义

查找指定 StylusPointDescriptionDescription 属性的交集。

public:
 System::Windows::Input::StylusPointCollection ^ Reformat(System::Windows::Input::StylusPointDescription ^ subsetToReformatTo);
public System.Windows.Input.StylusPointCollection Reformat (System.Windows.Input.StylusPointDescription subsetToReformatTo);
member this.Reformat : System.Windows.Input.StylusPointDescription -> System.Windows.Input.StylusPointCollection
Public Function Reformat (subsetToReformatTo As StylusPointDescription) As StylusPointCollection

参数

返回

包含 StylusPointCollection(指定 StylusPointDescription 的子集)和 StylusPointDescription(由当前 StylusPointDescription 使用)的 StylusPointCollection

例外

subsetToReformatTo 不是 Description 属性的子集。

示例

以下示例演示如何创建使用不同 StylusPointDescription的新 StylusPointCollection

StylusPointDescription description1 =
      new StylusPointDescription(new StylusPointPropertyInfo[]
                    {
                        new StylusPointPropertyInfo(StylusPointProperties.X),
                        new StylusPointPropertyInfo(StylusPointProperties.Y),
                        new StylusPointPropertyInfo(StylusPointProperties.NormalPressure),
                        new StylusPointPropertyInfo(StylusPointProperties.XTiltOrientation),
                        new StylusPointPropertyInfo(StylusPointProperties.YTiltOrientation),
                        new StylusPointPropertyInfo(StylusPointProperties.BarrelButton)
                    });

// Create a StylusPointCollection that uses description1 as its
// StylusPointDescription.
StylusPointCollection points = new StylusPointCollection(description1);

StylusPointDescription description2 =   
      new StylusPointDescription(new StylusPointPropertyInfo[]
                    {
                        new StylusPointPropertyInfo(StylusPointProperties.X),
                        new StylusPointPropertyInfo(StylusPointProperties.Y),
                        new StylusPointPropertyInfo(StylusPointProperties.NormalPressure),
                        new StylusPointPropertyInfo(StylusPointProperties.ButtonPressure),
                        new StylusPointPropertyInfo(StylusPointProperties.BarrelButton)
                    });

// Find the common StylusPointDescription between description1
// and description2.  Get a StylusPointCollection that uses the
// common StylusPointDescription.
StylusPointDescription common =
    StylusPointDescription.GetCommonDescription(description1, description2);

StylusPointCollection points2 = points.Reformat(common);
Dim description1 As New StylusPointDescription( _
    New StylusPointPropertyInfo() {New StylusPointPropertyInfo(StylusPointProperties.X), _
                                   New StylusPointPropertyInfo(StylusPointProperties.Y), _
                                   New StylusPointPropertyInfo(StylusPointProperties.NormalPressure), _
                                   New StylusPointPropertyInfo(StylusPointProperties.XTiltOrientation), _
                                   New StylusPointPropertyInfo(StylusPointProperties.YTiltOrientation), _
                                   New StylusPointPropertyInfo(StylusPointProperties.BarrelButton)})

' Create a StylusPointCollection that uses description1 as its
' StylusPointDescription.
Dim points As New StylusPointCollection(description1)

Dim description2 As New StylusPointDescription( _
    New StylusPointPropertyInfo() {New StylusPointPropertyInfo(StylusPointProperties.X), _
                                   New StylusPointPropertyInfo(StylusPointProperties.Y), _
                                   New StylusPointPropertyInfo(StylusPointProperties.NormalPressure), _
                                   New StylusPointPropertyInfo(StylusPointProperties.ButtonPressure), _
                                   New StylusPointPropertyInfo(StylusPointProperties.BarrelButton)})

' Find the common StylusPointDescription between description1
' and description2.  Get a StylusPointCollection that uses the
' common StylusPointDescription.
Dim common As StylusPointDescription = _
        StylusPointDescription.GetCommonDescription(description1, description2)

Dim points2 As StylusPointCollection = points.Reformat(common)

注解

subsetToReformatTo 是一个 , StylusPointDescription 它描述属于 Description 属性的值的子集。 GetCommonDescription使用 方法获取与StylusPointDescription当前 StylusPointCollection的 相交Description的 。

方法Reformat返回一个 ,StylusPointCollection其中包含与属于当前 StylusPointCollection的对象相同的 StylusPoint 对象。 StylusPointStylusPointCollection 中的 对象使用 subsetToReformatTo 作为 StylusPointDescription

注意

Reformat StylusPointPropertyInfo使用 属性的约束Description,即使 中的subsetToReformatTo约束不同。 例如,如果 subsetToReformatTo 使用值 0 和 1023, NormalPressureDescription 使用值 0 和 255。 Reformat StylusPointDescription使用值 0 和 255 返回 。

适用于