共用方式為


StylusPointDescription.GetCommonDescription 方法

定義

傳回指定之 StylusPointDescription 物件的交集。

public:
 static System::Windows::Input::StylusPointDescription ^ GetCommonDescription(System::Windows::Input::StylusPointDescription ^ stylusPointDescription, System::Windows::Input::StylusPointDescription ^ stylusPointDescriptionPreserveInfo);
public static System.Windows.Input.StylusPointDescription GetCommonDescription (System.Windows.Input.StylusPointDescription stylusPointDescription, System.Windows.Input.StylusPointDescription stylusPointDescriptionPreserveInfo);
static member GetCommonDescription : System.Windows.Input.StylusPointDescription * System.Windows.Input.StylusPointDescription -> System.Windows.Input.StylusPointDescription
Public Shared Function GetCommonDescription (stylusPointDescription As StylusPointDescription, stylusPointDescriptionPreserveInfo As StylusPointDescription) As StylusPointDescription

參數

stylusPointDescription
StylusPointDescription

要交集的第一個 StylusPointDescription

stylusPointDescriptionPreserveInfo
StylusPointDescription

要交集的第二個 StylusPointDescription

傳回

StylusPointDescription 其中包含同時存在於兩個指定 StylusPointDescription 物件中的屬性。

範例

下列範例示範如何從兩個不同的StylusPointDescription物件中尋找通用StylusPointDescription的 。

StylusDevice currentStylus = Stylus.CurrentStylusDevice;
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)
                    });

StylusPointDescription description2 = currentStylus.GetStylusPoints(inkCanvas1).Description;

StylusPointDescription description3 = 
    StylusPointDescription.GetCommonDescription(description1, description2);

StylusPointCollection points = currentStylus.GetStylusPoints(inkCanvas1, description3);
Dim currentStylus As StylusDevice = Stylus.CurrentStylusDevice

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)})

Dim description2 As StylusPointDescription = currentStylus.GetStylusPoints(inkCanvas1).Description

Dim description3 As StylusPointDescription = _
                        StylusPointDescription.GetCommonDescription(description1, description2)

Dim points As StylusPointCollection = currentStylus.GetStylusPoints(inkCanvas1, description3)

備註

StylusPointDescription1stylusPointDescriptionPreserveInfo 可能會有通用屬性,但各自 StylusPointPropertyInfo 物件中指定的條件約束不同。 如果條件約束不同,方法會 GetCommonDescription 使用 StylusPointPropertyInfo from的 stylusPointDescriptionPreserveInfo

適用於