Редагувати

Поділитися через


StylusPoint Constructors

Definition

Initializes a new instance of the StylusPoint class.

Overloads

StylusPoint(Double, Double)

Initializes a new instance of the StylusPoint class using specified (x, y) coordinates.

StylusPoint(Double, Double, Single)

Initializes a new instance of the StylusPoint class using specified (x, y) coordinates and pressure.

StylusPoint(Double, Double, Single, StylusPointDescription, Int32[])

Initializes a new instance of the StylusPoint class using specified (x, y) coordinates, a pressureFactor, and additional parameters specified in the StylusPointDescription.

StylusPoint(Double, Double)

Initializes a new instance of the StylusPoint class using specified (x, y) coordinates.

public:
 StylusPoint(double x, double y);
public StylusPoint (double x, double y);
new System.Windows.Input.StylusPoint : double * double -> System.Windows.Input.StylusPoint
Public Sub New (x As Double, y As Double)

Parameters

x
Double

The x-coordinate of the StylusPoint.

y
Double

The y-coordinate of the StylusPoint.

Examples

The following example demonstrates how to create a StylusPoint.

StylusPointDescription newDescription =
      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)
                    });

int[] propertyValues = { 1800, 1000, 1 };

StylusPoint newStylusPoint = new StylusPoint(100, 100, .5f, newDescription, propertyValues);
Dim newDescription 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 propertyValues As Integer() = {1800, 1000, 1}

Dim newStylusPoint As New StylusPoint(100, 100, 0.5F, newDescription, propertyValues)

Applies to

StylusPoint(Double, Double, Single)

Initializes a new instance of the StylusPoint class using specified (x, y) coordinates and pressure.

public:
 StylusPoint(double x, double y, float pressureFactor);
public StylusPoint (double x, double y, float pressureFactor);
new System.Windows.Input.StylusPoint : double * double * single -> System.Windows.Input.StylusPoint
Public Sub New (x As Double, y As Double, pressureFactor As Single)

Parameters

x
Double

The x-coordinate of the StylusPoint.

y
Double

The y-coordinate of the StylusPoint.

pressureFactor
Single

The amount of pressure applied to the StylusPoint.

Exceptions

pressureFactor is less than 0 or greater than 1.

Examples

The following example demonstrates how to create a StylusPoint.

StylusPointDescription newDescription =
      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)
                    });

int[] propertyValues = { 1800, 1000, 1 };

StylusPoint newStylusPoint = new StylusPoint(100, 100, .5f, newDescription, propertyValues);
Dim newDescription 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 propertyValues As Integer() = {1800, 1000, 1}

Dim newStylusPoint As New StylusPoint(100, 100, 0.5F, newDescription, propertyValues)

Remarks

pressureFactor must have a value between 0 and 1, inclusive. A value of 0 indicates that no pressure is applied, while a value of 1 indicates that the maximum amount of pressure is applied. A value of 0.5 indicates that 50% of the maximum pressure is applied, and so on.

Applies to

StylusPoint(Double, Double, Single, StylusPointDescription, Int32[])

Initializes a new instance of the StylusPoint class using specified (x, y) coordinates, a pressureFactor, and additional parameters specified in the StylusPointDescription.

public:
 StylusPoint(double x, double y, float pressureFactor, System::Windows::Input::StylusPointDescription ^ stylusPointDescription, cli::array <int> ^ additionalValues);
public StylusPoint (double x, double y, float pressureFactor, System.Windows.Input.StylusPointDescription stylusPointDescription, int[] additionalValues);
new System.Windows.Input.StylusPoint : double * double * single * System.Windows.Input.StylusPointDescription * int[] -> System.Windows.Input.StylusPoint
Public Sub New (x As Double, y As Double, pressureFactor As Single, stylusPointDescription As StylusPointDescription, additionalValues As Integer())

Parameters

x
Double

The x-coordinate of the StylusPoint.

y
Double

The y-coordinate of the StylusPoint.

pressureFactor
Single

The amount of pressure applied to the StylusPoint.

stylusPointDescription
StylusPointDescription

A StylusPointDescription that specifies the additional properties stored in the StylusPoint.

additionalValues
Int32[]

An array of 32-bit signed integers that contains the values of the properties defined in stylusPointDescription.

Exceptions

pressureFactor is less than 0 or greater than 1.

-or-

The values in additionalValues that correspond to button properties are not 0 or 1.

The number of values in additionalValues does not match the number of properties in stylusPointDescription minus 3.

Examples

The following example demonstrates how to create a StylusPoint.

StylusPointDescription newDescription =
      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)
                    });

int[] propertyValues = { 1800, 1000, 1 };

StylusPoint newStylusPoint = new StylusPoint(100, 100, .5f, newDescription, propertyValues);
Dim newDescription 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 propertyValues As Integer() = {1800, 1000, 1}

Dim newStylusPoint As New StylusPoint(100, 100, 0.5F, newDescription, propertyValues)

Applies to