StylusPoint 构造函数

定义

初始化 StylusPoint 类的新实例。

重载

名称 说明
StylusPoint(Double, Double)

使用指定的 (x, y) 坐标初始化类的新实例 StylusPoint

StylusPoint(Double, Double, Single)

使用指定的 (x, y) 坐标和压力初始化类的新实例 StylusPoint

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

使用指定的 (x, y) 坐标、在 StylusPoint 中指定的pressureFactor其他参数初始化类的新实例StylusPointDescription

StylusPoint(Double, Double)

使用指定的 (x, y) 坐标初始化类的新实例 StylusPoint

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)

参数

x
Double

的 x 坐标 StylusPoint

y
Double

的 y 坐标 StylusPoint

示例

以下示例演示如何创建一个 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)

适用于

StylusPoint(Double, Double, Single)

使用指定的 (x, y) 坐标和压力初始化类的新实例 StylusPoint

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)

参数

x
Double

的 x 坐标 StylusPoint

y
Double

的 y 坐标 StylusPoint

pressureFactor
Single

应用于 StylusPoint该项的压力量。

例外

pressureFactor 小于 0 或大于 1。

示例

以下示例演示如何创建一个 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)

注解

pressureFactor 必须具有介于 0 和 1 之间的值(含)。 值为 0 表示未应用压力,而值 1 表示应用最大压力量。 值为 0.5 表示应用最大压力的 50%,依此等。

适用于

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

使用指定的 (x, y) 坐标、在 StylusPoint 中指定的pressureFactor其他参数初始化类的新实例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())

参数

x
Double

的 x 坐标 StylusPoint

y
Double

的 y 坐标 StylusPoint

pressureFactor
Single

应用于 StylusPoint该项的压力量。

stylusPointDescription
StylusPointDescription

一个 StylusPointDescription ,指定存储在 .. 中的 StylusPoint附加属性。

additionalValues
Int32[]

一个由 32 位带符号整数构成的数组,其中包含在中 stylusPointDescription定义的属性的值。

例外

pressureFactor 小于 0 或大于 1。

-或-

对应于按钮属性的值 additionalValues 不是 0 或 1。

中的 additionalValues 值数与减 3 中的 stylusPointDescription 属性数不匹配。

示例

以下示例演示如何创建一个 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)

适用于