StylusPoint 建構函式

定義

初始化 StylusPoint 類別的新執行個體。

多載

StylusPoint(Double, Double)

使用指定的 (x, y) 座標,初始化 StylusPoint 類別的新執行個體。

StylusPoint(Double, Double, Single)

使用指定的 (x, y) 座標和壓力,初始化 StylusPoint 類別的新執行個體。

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

使用指定的 (x, y) 座標、pressureFactor,和 StylusPointDescription 中指定的其他參數,初始化 StylusPoint 類別的新執行個體。

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

StylusPoint 的 X 座標。

y
Double

StylusPoint 的 Y 座標。

範例

下列範例示範如何建立 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

StylusPoint 的 X 座標。

y
Double

StylusPoint 的 Y 座標。

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) 座標、pressureFactor,和 StylusPointDescription 中指定的其他參數,初始化 StylusPoint 類別的新執行個體。

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

StylusPoint 的 X 座標。

y
Double

StylusPoint 的 Y 座標。

pressureFactor
Single

套用至 StylusPoint 的壓力量。

stylusPointDescription
StylusPointDescription

StylusPointDescription,指定儲存於 StylusPoint 中的其他屬性。

additionalValues
Int32[]

32 位元帶正負號整數的陣列,其中包含 stylusPointDescription 中定義的屬性值。

例外狀況

pressureFactor 小於 0 或大於 1。

-或-

additionalValues 中對應到按鈕屬性的值不是 0 或 1。

additionalValues 中的值數目不符合 stylusPointDescription 中的屬性數目減去 3。

範例

下列範例示範如何建立 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)

適用於