Partilhar via


StylusPointCollection.Reformat(StylusPointDescription) Método

Definição

Localiza a interseção da StylusPointDescription especificada e da propriedade Description.

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

Parâmetros

subsetToReformatTo
StylusPointDescription

Uma StylusPointDescription a ser interseccionada com a StylusPointDescription da StylusPointCollection atual.

Retornos

Uma StylusPointCollection que tem uma StylusPointDescription que é um subconjunto da StylusPointDescription especificada e a StylusPointDescription que a StylusPointCollection atual usa.

Exceções

subsetToReformatTo não é um subconjunto da propriedade Description.

Exemplos

O exemplo a seguir demonstra como criar um novo StylusPointCollection que usa um diferente StylusPointDescription.

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)

Comentários

subsetToReformatTo é um StylusPointDescription que descreve um subconjunto de valores pertencentes à Description propriedade . Use o GetCommonDescription método para obter um StylusPointDescription que intersecione o Description do atual StylusPointCollection.

O Reformat método retorna um StylusPointCollection que contém os mesmos StylusPoint objetos que os que pertencem ao atual StylusPointCollection. Os StylusPoint objetos no novo StylusPointCollection usam subsetToReformatTo como o StylusPointDescription.

Observação

Reformat usa as restrições do StylusPointPropertyInfo da Description propriedade , mesmo que as restrições em subsetToReformatTo sejam diferentes. Por exemplo, se subsetToReformatTo usa os valores 0 e 1023 para NormalPressure , enquanto Description usa os valores 0 e 255. Reformat retorna um StylusPointDescription usando os valores, 0 e 255.

Aplica-se a