locked
Zoom in on a SwapChainPanel

    Question

  • I have a Windows Store app in which one can draw. It uses a SwapChainPanel as a base class and getting input from the well known CreateCoreIndependentInputSource on a background thread. Now I want to implement zoom functionality. I tried by using a scrollviewer.  Basically I want to combine the DrawingPanel and D2DPanel in the XAML SwapChainPanel DirectX interop sample http://code.msdn.microsoft.com/windowsapps/XAML-SwapChainPanel-00cb688b

    However If I put the SwapChainPanel based control inside a scrollviewer, the control does not respond to pinching etc. In the D2DPanel sample it seems that that is all you need to do. Do I need to do more or it is not working because of the input source is catching all the pointer events?

    Or is there another good alternative for implementing zoom/scroll functionality on a SwapChainPanel?

    Ronald

    Monday, September 08, 2014 2:07 PM

Answers

  • As I know SwapChainPanel should have manipulation events instead of Pointer events. See this for more information: Using manipulation events, try with it to see if you can handle the events, however I think Rob's blog already tell you that all the events has been handled by  CoreIndependentInputSource.

    But I'm not quite sure, I remember pointer is not single one, it could have multiple instance when you use finger, find them from: PointerPoint.PointerId | pointerId property, you can handle them if you need.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Wednesday, September 10, 2014 10:31 AM
    Moderator

All replies

  • Hi Ronald,

    Look like Rob's blog will help you with such issue: http://blogs.msdn.com/b/wsdevsol/archive/2013/02/16/where-did-all-my-gestures-go.aspx

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 09, 2014 3:08 AM
    Moderator
  • Where in Rob's blog it is described that the scrollviewer takes over all pointer events handling, it seems that in my case CoreIndependentInputSource takes over the pointer event handling. The more I think about it, and because the drawing and scaling need to be integrated seamless (for example 1 finger draw, 2 fingers translate/zoom), the translate/zoom functionality needs to be implemented by the app itself, all based on CoreIndependentInputSource events PointerPressed, PointerMoved, and PointerReleased.

    Ronald

    Tuesday, September 09, 2014 7:01 AM
  • As I know SwapChainPanel should have manipulation events instead of Pointer events. See this for more information: Using manipulation events, try with it to see if you can handle the events, however I think Rob's blog already tell you that all the events has been handled by  CoreIndependentInputSource.

    But I'm not quite sure, I remember pointer is not single one, it could have multiple instance when you use finger, find them from: PointerPoint.PointerId | pointerId property, you can handle them if you need.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Wednesday, September 10, 2014 10:31 AM
    Moderator