locked
physicalDeviceRect vs screenRect

    Question

  • Hello guys.

    I'm wondering about the difference between physicalDeviceRect and screenRect. It seems like for the mouse, they hold the same values, but for touch, that doesn't happen. Can anyone please be kind enough to explain the difference.

    thanks.


    Luis Abreu


    Monday, February 27, 2012 9:46 PM

Answers

  • Hi Luis,

    In winRT both rectangles are in DIPS (device independent pixels)

    • PointerDevice.PhysicalDeviceRect
      – This is a rectangle that specifies the range of coordinates that a given
      device support.  The rectangle is in 96 DPI units.
    • PointerDevice.PhysicalDeviceRect
      (ScreenRect*) – This is a rectangle that specifies the range of screen
      coordinates that a given device is mapped to.  The units are in DIP
      pixels.






    Since the mouse doesn’t have
    information about the physical size of a display and it’s usually mapped to the
    full desktop (not just one display) PhysicalDeviceRect  is computed in a
    different way using the current dpi (which may or may not be accurate depending
    on the EDID information for the display).
    screenRect
    should be identical.



    Jeff Sanders (MSFT)


    Wednesday, February 29, 2012 1:03 PM
    Moderator

All replies

  • Hi Luis,

    In winRT both rectangles are in DIPS (device independent pixels)

    • PointerDevice.PhysicalDeviceRect
      – This is a rectangle that specifies the range of coordinates that a given
      device support.  The rectangle is in 96 DPI units.
    • PointerDevice.PhysicalDeviceRect
      (ScreenRect*) – This is a rectangle that specifies the range of screen
      coordinates that a given device is mapped to.  The units are in DIP
      pixels.






    Since the mouse doesn’t have
    information about the physical size of a display and it’s usually mapped to the
    full desktop (not just one display) PhysicalDeviceRect  is computed in a
    different way using the current dpi (which may or may not be accurate depending
    on the EDID information for the display).
    screenRect
    should be identical.



    Jeff Sanders (MSFT)


    Wednesday, February 29, 2012 1:03 PM
    Moderator
  • Thanks Jeff!



    Luis Abreu

    Wednesday, February 29, 2012 7:31 PM