StylusPointCollection.Reformat(StylusPointDescription) Metod

Definition

Hittar skärningspunkten för den angivna StylusPointDescription och egenskapen 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

Parametrar

subsetToReformatTo
StylusPointDescription

A StylusPointDescription som ska korsas med den StylusPointDescription aktuella StylusPointCollection.

Returer

En StylusPointCollection som har en StylusPointDescription som är en delmängd av den angivna StylusPointDescription och StylusPointDescription som den aktuella StylusPointCollection använder.

Undantag

subsetToReformatTo är inte en delmängd av Description egenskapen.

Exempel

I följande exempel visas hur du skapar en ny StylusPointCollection som använder en annan 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)

Kommentarer

subsetToReformatTo är en StylusPointDescription som beskriver en delmängd av värden som tillhör egenskapen Description . GetCommonDescription Använd metoden för att hämta en StylusPointDescription som korsar den Description aktuella StylusPointCollection.

Metoden Reformat returnerar ett StylusPointCollection som innehåller samma StylusPoint objekt som de som tillhör den aktuella StylusPointCollection. Objekten StylusPoint i den nya StylusPointCollection används subsetToReformatTo som StylusPointDescription.

Note

Reformat använder begränsningarna från StylusPointPropertyInfoDescription egenskapen, även om begränsningarna i subsetToReformatTo är olika. Om du till exempel subsetToReformatTo använder värdena 0 och 1023 för NormalPressure medan Description värdena 0 och 255 används. Reformat returnerar en StylusPointDescription med värdena 0 och 255.

Gäller för