Прочитај на енглеском Уреди

Делите путем


StylusPointDescription.GetCommonDescription Method

Definition

Returns the intersection of the specified StylusPointDescription objects.

C#
public static System.Windows.Input.StylusPointDescription GetCommonDescription(System.Windows.Input.StylusPointDescription stylusPointDescription, System.Windows.Input.StylusPointDescription stylusPointDescriptionPreserveInfo);

Parameters

stylusPointDescription
StylusPointDescription

The first StylusPointDescription to intersect.

stylusPointDescriptionPreserveInfo
StylusPointDescription

The second StylusPointDescription to intersect.

Returns

A StylusPointDescription that contains the properties that are present in both of the specified StylusPointDescription objects.

Examples

The following example demonstrates how to find the common StylusPointDescription from two different StylusPointDescription objects.

C#
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);

Remarks

StylusPointDescription1 and stylusPointDescriptionPreserveInfo may have a common property, yet the constraints specified in their respective StylusPointPropertyInfo objects differ. If the constraints differ, the GetCommonDescription method uses the StylusPointPropertyInfo from stylusPointDescriptionPreserveInfo.

Applies to

Производ Верзије
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10