PointerPoint 類別

定義

提供與單一滑鼠、手寫筆/手寫筆或觸控連絡人相關聯的輸入指標基本屬性。

public ref class PointerPoint sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.WindowsAppSDKContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class PointerPoint final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.WindowsAppSDKContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class PointerPoint
Public NotInheritable Class PointerPoint
繼承
Object Platform::Object IInspectable PointerPoint
屬性

範例

在下列範例中,我們使用 PointerPoint 物件查詢各種指標屬性。

private string queryPointer(PointerPoint ptrPt)
{
    String details = "";

    switch (ptrPt.PointerDeviceType)
    {
        case PointerDeviceType.Mouse:
            details += "\nPointer type: mouse";
            break;
        case PointerDeviceType.Pen:
            details += "\nPointer type: pen";
            if (ptrPt.IsInContact)
            {
                details += "\nPressure: " + ptrPt.Properties.Pressure;
                details += "\nrotation: " + ptrPt.Properties.Orientation;
                details += "\nTilt X: " + ptrPt.Properties.XTilt;
                details += "\nTilt Y: " + ptrPt.Properties.YTilt;
                details += "\nBarrel button pressed: " + ptrPt.Properties.IsBarrelButtonPressed;
            }
            break;
        case PointerDeviceType.Touch:
            details += "\nPointer type: touch";
            details += "\nrotation: " + ptrPt.Properties.Orientation;
            details += "\nTilt X: " + ptrPt.Properties.XTilt;
            details += "\nTilt Y: " + ptrPt.Properties.YTilt;
            break;
        default:
            details += "\nPointer type: n/a";
            break;
    }

    details += "\nPointer Id: " + ptrPt.PointerId.ToString() +
        "\nPointer location: " + ptrPt.Position.X + ", " + ptrPt.Position.Y;

    return details;
}

備註

如需可透過 Properties 存取的擴充屬性,請參閱PointerPointProperties

PointerPoint 座標空間取決於擷取它的內容。 從 PointerRoutedEventArgs.GetCurrentPoint擷取時,指標的座標會相對於裝置獨立圖元中提供的 UIElement

屬性

FrameId

取得輸入框架的識別碼。

IsInContact

取得值,這個值表示輸入裝置 (觸控、手寫筆/手寫筆) 在觸控 (觸控) 數位板介面上按下,還是按下滑鼠按鍵。

PointerDeviceType

取得與輸入指標相關聯的輸入裝置類型。

PointerId

取得輸入指標的唯一識別碼。

Position

取得輸入指標的位置。

Properties

取得輸入指標的擴充資訊。

Timestamp

取得輸入發生的時間。

方法

GetTransformedPoint(IPointerPointTransform)

使用應用程式定義的轉換來轉換目前的 PointerPoint ,以擷取新的 PointerPoint 物件。

適用於

另請參閱