none
[UWP]Using InkCanvas for drawing free hand path is not working in Touch RRS feed

  • Question

  • Hi,

    I am using InkCanvas control to draw the path over the image (which is inside the grid control). My requirement is to draw a path using single finger and zoom the image using double finger. But the actual behavior of Inkpresenter is when setting the InkPresenter's InputDeviceType as Mouse or Touch, it doesn't allow to detect the PointerEntered or PointerPressed to perform zoom after draw a path. If we set the InkPresenter's InputDeviceType as None we can use the above events to perform zoom.

     

    For that, I am changing the InkPresenter's InputDeviceType as Mouse or Touch in grid's PointerEntered event and change the InkPresenter's InputDeviceType as None in InkPresenter's StrokeCollected event. This is properly working when i am trying to draw a path using mouse, but it does not work on Touch.


    C# - Events

    private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args)

    {

    canvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.None;

    }

    private void Grid_PointerEntered(object sender, PointerRoutedEventArgs e)

    {

        canvas.InkPresenter.InputDeviceTypes =

       Windows.UI.Core.CoreInputDeviceTypes.Mouse |

       Windows.UI.Core.CoreInputDeviceTypes.Pen | Windows.UI.Core.CoreInputDeviceTypes.Touch;

    }

    Please find the POC sample.

    Sample : https://drive.google.com/open?id=1wT9MvnJyXWR91ifUV3tJZJIaNluhfyK_

    It is looking framework level issue. Anyone confirm this.?
    • Edited by Santhiya Arulsamy Tuesday, December 31, 2019 7:24 AM
    • Moved by CoolDadTx Tuesday, December 31, 2019 7:12 PM UWP related
    Tuesday, December 31, 2019 6:54 AM

All replies

  • Hi Santhiya Arulsamy,

    Since this thread is related to UWP, so I suggest that you can ask this question in  Microsoft Q&A.

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 31, 2019 9:31 AM