StylusDevice.GetStylusPoints 方法

定義

傳回一個 StylusPointCollection,內含收集自手寫筆的 StylusPoint 物件。Returns a StylusPointCollection that contains StylusPoint objects collected from the stylus.

多載

GetStylusPoints(IInputElement)

傳回一個 StylusPointCollection,內含收集自手寫筆的 StylusPoint 物件。Returns a StylusPointCollection that contains StylusPoint objects collected from the stylus.

GetStylusPoints(IInputElement, StylusPointDescription)

傳回一個 StylusPointCollection,內含收集自手寫筆的 StylusPoint 物件。Returns a StylusPointCollection that contains StylusPoint objects collected from the stylus. 使用指定的 StylusPointDescriptionUses the specified StylusPointDescription.

GetStylusPoints(IInputElement)

傳回一個 StylusPointCollection,內含收集自手寫筆的 StylusPoint 物件。Returns a StylusPointCollection that contains StylusPoint objects collected from the stylus.

public:
 System::Windows::Input::StylusPointCollection ^ GetStylusPoints(System::Windows::IInputElement ^ relativeTo);
public System.Windows.Input.StylusPointCollection GetStylusPoints (System.Windows.IInputElement relativeTo);
member this.GetStylusPoints : System.Windows.IInputElement -> System.Windows.Input.StylusPointCollection
Public Function GetStylusPoints (relativeTo As IInputElement) As StylusPointCollection

參數

relativeTo
IInputElement

StylusPointCollection 中 (x,y) 座標所對應的 IInputElementThe IInputElement to which the (x,y) coordinates in the StylusPointCollection are mapped.

傳回

內含收集自手寫筆之 StylusPointCollection 物件的 StylusPointA StylusPointCollection that contains StylusPoint objects that the stylus collected.

例外狀況

relativeTo 不是 UIElement,也不是 FrameworkContentElementrelativeTo is neither UIElement or FrameworkContentElement.

範例

下列範例示範如何StylusPointCollection StylusDevice從取得。The following example demonstrates how to get the StylusPointCollection from the StylusDevice.

StylusPointCollection myStylusPoints =
            myStylusDevice.GetStylusPoints(myStylusDevice.Target);
textbox1.AppendText("Got " + myStylusPoints.Count.ToString() + " packets\n");
Dim myStylusPoints As StylusPointCollection = _
    myStylusDevice.GetStylusPoints(myStylusDevice.Target)
textbox1.AppendText("Got " + myStylusPoints.Count.ToString() + " packets" + vbCrLf)

GetStylusPoints(IInputElement, StylusPointDescription)

傳回一個 StylusPointCollection,內含收集自手寫筆的 StylusPoint 物件。Returns a StylusPointCollection that contains StylusPoint objects collected from the stylus. 使用指定的 StylusPointDescriptionUses the specified StylusPointDescription.

public:
 System::Windows::Input::StylusPointCollection ^ GetStylusPoints(System::Windows::IInputElement ^ relativeTo, System::Windows::Input::StylusPointDescription ^ subsetToReformatTo);
public System.Windows.Input.StylusPointCollection GetStylusPoints (System.Windows.IInputElement relativeTo, System.Windows.Input.StylusPointDescription subsetToReformatTo);
member this.GetStylusPoints : System.Windows.IInputElement * System.Windows.Input.StylusPointDescription -> System.Windows.Input.StylusPointCollection
Public Function GetStylusPoints (relativeTo As IInputElement, subsetToReformatTo As StylusPointDescription) As StylusPointCollection

參數

relativeTo
IInputElement

StylusPointCollection 中 (x,y) 座標所對應的 IInputElementThe IInputElement to which the (x y) coordinates in the StylusPointCollection are mapped.

傳回

內含收集自手寫筆之 StylusPointCollection 物件的 StylusPointA StylusPointCollection that contains StylusPoint objects collected from the stylus.

例外狀況

relativeTo 不是 UIElement,也不是 FrameworkContentElementrelativeTo is neither UIElement or FrameworkContentElement.

範例

下列範例示範如何從目前StylusPoint StylusDevice的取得物件。The following example demonstrates how to get StylusPoint objects from the current StylusDevice.

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)

備註

subsetToReformatTo必須與Description GetStylusPoints(IInputElement)方法所使用之的StylusPointCollection屬性相容。subsetToReformatTo must be compatible with the Description property of the StylusPointCollection used by the GetStylusPoints(IInputElement) method. StylusPointDescription在呼叫方法GetStylusPoints(IInputElement, StylusPointDescription)之前, 請使用方法來取得。GetCommonDescriptionUse the GetCommonDescription method to get a StylusPointDescription before calling the GetStylusPoints(IInputElement, StylusPointDescription) method.

適用於