PointerPoint 클래스

정의

단일 마우스, 펜/스타일러스 또는 터치 접점과 연결된 입력 포인터에 대한 기본 속성을 제공합니다.

public ref class PointerPoint sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
class PointerPoint final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
public sealed class PointerPoint
Public NotInheritable Class PointerPoint
상속
Object Platform::Object IInspectable PointerPoint
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

다음 예제에서는 PointerPoint 개체를 사용하여 다양한 포인터 속성을 쿼리합니다.

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

    switch (ptrPt.PointerDevice.PointerDeviceType)
    {
        case Windows.Devices.Input.PointerDeviceType.Mouse:
            details += "\nPointer type: mouse";
            break;
        case Windows.Devices.Input.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 Windows.Devices.Input.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;
    }

    GeneralTransform gt = Target.TransformToVisual(page);
    Point screenPoint;

    screenPoint = gt.TransformPoint(new Point(ptrPt.Position.X, ptrPt.Position.Y));
    details += "\nPointer Id: " + ptrPt.PointerId.ToString() +
        "\nPointer location (parent): " + ptrPt.Position.X + ", " + ptrPt.Position.Y +
        "\nPointer location (screen): " + screenPoint.X + ", " + screenPoint.Y;
    return details;
}
String queryPointer(PointerPoint ptrPt)
{
    String details = "";

    switch (ptrPt.PointerDevice.PointerDeviceType)
    {
        case Windows.Devices.Input.PointerDeviceType.Mouse:
            details += "\nPointer type: mouse";
            break;
        case Windows.Devices.Input.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 Windows.Devices.Input.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;
    }

    GeneralTransform gt = Target.TransformToVisual(page);
    Point screenPoint;

    screenPoint = gt.TransformPoint(new Point(ptrPt.Position.X, ptrPt.Position.Y));
    details += "\nPointer Id: " + ptrPt.PointerId.ToString() +
        "\nPointer location (parent): " + ptrPt.Position.X + ", " + ptrPt.Position.Y +
        "\nPointer location (screen): " + screenPoint.X + ", " + screenPoint.Y;
    return details;
}

설명

PointerPoint 클래스는 IPointerPoint를 구현합니다.

속성을 통해 액세스할 수 있는 확장 속성은 PointerPointProperties 를 참조 하세요.

대부분의 경우 선택한 언어 프레임워크에서 포인터 이벤트 처리기의 이벤트 인수를 통해 포인터 정보를 가져오는 것이 좋습니다.

이벤트 인수가 앱에 필요한 포인터 세부 정보를 기본적으로 노출하지 않는 경우 PointerRoutedEventArgsGetCurrentPointGetIntermediatePoints 메서드를 통해 확장 포인터 데이터에 액세스할 수 있습니다. 이러한 메서드를 사용하여 포인터 데이터의 컨텍스트를 지정합니다.

정적 PointerPoint 메서드인 GetCurrentPointGetIntermediatePoints는 항상 앱 컨텍스트를 사용합니다.

참고

이 클래스는 민첩하지 않으므로 스레딩 모델 및 마샬링 동작을 고려해야 합니다. 자세한 내용은 스레딩 및 마샬링(C++/CX)다중 스레드 환경(.NET)에서 Windows 런타임 개체 사용을 참조하세요.

속성

FrameId

입력 프레임의 ID를 가져옵니다.

IsInContact

입력 장치(터치, 펜/스타일러스)가 디지타이저 표면에 닿는지 또는 마우스 단추를 눌렀는지 여부를 나타내는 값을 가져옵니다.

PointerDevice

입력 포인터와 연결된 디바이스에 대한 정보를 가져옵니다.

PointerId

입력 포인터의 고유 식별자를 가져옵니다.

Position

클라이언트 좌표에서 포인터 입력의 위치를 가져옵니다.

Properties

입력 포인터에 대한 확장 정보를 가져옵니다.

RawPosition

입력 디바이스에서 보고한 입력 포인터의 클라이언트 좌표를 가져옵니다.

Timestamp

입력이 발생한 시간을 가져옵니다.

메서드

GetCurrentPoint(UInt32)

지정된 포인터의 위치 및 상태 정보를 검색합니다.

대부분의 경우 선택한 언어 프레임워크에서 포인터 이벤트 처리기의 이벤트 인수를 통해 포인터 정보를 가져오는 것이 좋습니다(JavaScript를 사용하는 Windows 앱, C++, C#또는 Visual Basic을 사용하는 UWP 앱 또는 C++와 함께 DirectX를 사용하는 UWP 앱).

이벤트 인수가 앱에 필요한 포인터 세부 정보를 기본적으로 노출하지 않는 경우 PointerRoutedEventArgsGetCurrentPointGetIntermediatePoints 메서드를 통해 확장 포인터 데이터에 액세스할 수 있습니다. 이러한 메서드를 사용하여 포인터 데이터의 컨텍스트를 지정합니다.

정적 PointerPoint 메서드인 GetCurrentPoint 및 GetIntermediatePoints는 항상 앱 컨텍스트를 사용합니다.

GetCurrentPoint(UInt32, IPointerPointTransform)

지정된 포인터에 대한 변환된 정보를 검색합니다.

대부분의 경우 선택한 언어 프레임워크에서 포인터 이벤트 처리기의 이벤트 인수를 통해 포인터 정보를 가져오는 것이 좋습니다(JavaScript를 사용하는 Windows 앱, C++, C#또는 Visual Basic을 사용하는 UWP 앱 또는 C++와 함께 DirectX를 사용하는 UWP 앱).

이벤트 인수가 앱에 필요한 포인터 세부 정보를 기본적으로 노출하지 않는 경우 PointerRoutedEventArgsGetCurrentPointGetIntermediatePoints 메서드를 통해 확장 포인터 데이터에 액세스할 수 있습니다. 이러한 메서드를 사용하여 포인터 데이터의 컨텍스트를 지정합니다.

정적 PointerPoint 메서드인 GetCurrentPointGetIntermediatePoints는 항상 앱 컨텍스트를 사용합니다.

GetIntermediatePoints(UInt32)

마지막 포인터 이벤트에서 현재 포인터 이벤트까지 지정된 포인터의 위치 및 상태 정보를 검색합니다.

대부분의 경우 선택한 언어 프레임워크에서 포인터 이벤트 처리기의 이벤트 인수를 통해 포인터 정보를 가져오는 것이 좋습니다(JavaScript를 사용하는 Windows 앱, C++, C#또는 Visual Basic을 사용하는 UWP 앱 또는 C++와 함께 DirectX를 사용하는 UWP 앱).

이벤트 인수가 앱에 필요한 포인터 세부 정보를 기본적으로 노출하지 않는 경우 PointerRoutedEventArgsGetCurrentPointGetIntermediatePoints 메서드를 통해 확장 포인터 데이터에 액세스할 수 있습니다. 이러한 메서드를 사용하여 포인터 데이터의 컨텍스트를 지정합니다.

정적 PointerPoint 메서드인 GetCurrentPoint 및 GetIntermediatePoints는 항상 앱 컨텍스트를 사용합니다.

GetIntermediatePoints(UInt32, IPointerPointTransform)

마지막 포인터 이벤트부터 현재 포인터 이벤트까지 지정된 포인터에 대한 변환된 위치 및 상태 정보를 검색합니다.

대부분의 경우 선택한 언어 프레임워크에서 포인터 이벤트 처리기의 이벤트 인수를 통해 포인터 정보를 가져오는 것이 좋습니다(JavaScript를 사용하는 Windows 앱, C++, C#또는 Visual Basic을 사용하는 UWP 앱 또는 C++와 함께 DirectX를 사용하는 UWP 앱).

이벤트 인수가 앱에 필요한 포인터 세부 정보를 기본적으로 노출하지 않는 경우 PointerRoutedEventArgsGetCurrentPointGetIntermediatePoints 메서드를 통해 확장 포인터 데이터에 액세스할 수 있습니다. 이러한 메서드를 사용하여 포인터 데이터의 컨텍스트를 지정합니다.

정적 PointerPoint 메서드인 GetCurrentPointGetIntermediatePoints는 항상 앱 컨텍스트를 사용합니다.

적용 대상

추가 정보