StylusPointDescription.GetCommonDescription Method

Returns the intersection of the specified StylusPointDescription objects.

Namespace:  System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public static StylusPointDescription GetCommonDescription(
	StylusPointDescription stylusPointDescription,
	StylusPointDescription stylusPointDescriptionPreserveInfo
)

Parameters

stylusPointDescription
Type: System.Windows.Input.StylusPointDescription
stylusPointDescriptionPreserveInfo
Type: System.Windows.Input.StylusPointDescription

The second StylusPointDescription to intersect.

Return Value

Type: System.Windows.Input.StylusPointDescription
A StylusPointDescription that contains the properties that are present if both of the specified StylusPointDescription objects.

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.

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

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

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft