Partilhar via


StylusDevice.GetStylusPoints Método

Definição

Retorna um StylusPointCollection que contém objetos StylusPoint coletados da caneta.

Sobrecargas

GetStylusPoints(IInputElement)

Retorna um StylusPointCollection que contém objetos StylusPoint coletados da caneta.

GetStylusPoints(IInputElement, StylusPointDescription)

Retorna um StylusPointCollection que contém objetos StylusPoint coletados da caneta. Usa o StylusPointDescription especificado.

GetStylusPoints(IInputElement)

Retorna um StylusPointCollection que contém objetos StylusPoint coletados da caneta.

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

Parâmetros

relativeTo
IInputElement

O IInputElement para o qual as coordenadas (x,y) no StylusPointCollection são mapeadas.

Retornos

Um StylusPointCollection que contém objetos StylusPoint que a caneta coletou.

Exceções

Exemplos

O exemplo a seguir demonstra como obter o StylusPointCollection do 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)

Aplica-se a

GetStylusPoints(IInputElement, StylusPointDescription)

Retorna um StylusPointCollection que contém objetos StylusPoint coletados da caneta. Usa o StylusPointDescription especificado.

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

Parâmetros

relativeTo
IInputElement

O IInputElement para o qual as coordenadas (x y) no StylusPointCollection são mapeadas.

Retornos

Um StylusPointCollection que contém objetos StylusPoint coletados da caneta.

Exceções

Exemplos

O exemplo a seguir demonstra como obter StylusPoint objetos do atual 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)

Comentários

subsetToReformatTo deve ser compatível com a Description propriedade do StylusPointCollection usado pelo GetStylusPoints(IInputElement) método . Use o GetCommonDescription método para obter um StylusPointDescription antes de chamar o GetStylusPoints(IInputElement, StylusPointDescription) método .

Aplica-se a