none
WPF Inkcanvas and Multitouch: using multitouch rendertransform for elements working fine, what about rendertransform for inkcanvas strokes ? RRS feed

  • Question

  • I developed an application in which all multi touch functionalities like zooming, panning ,rotation, scaling etc working fine using more than two fingers on elements.

    Because selected element contain 'ismanipulationenabled = true' and fires manipulation events in which am doing multi touch.

    But inkcanvas strokes doesn't contain 'ismanipulationenable' property, so what to do ?

    I dont want adorner controls for inkcanvas strokes to do that, i want to use only multi touch.

    Is any solution by using which the 'selected strokes' works for multi touch as i did for 'selected element' example

    1 finger for rotation
    2 fingers for scaling
    3 fingers for panning etc.

    Need urgent help ..

     

    Monday, August 1, 2011 8:44 AM

Answers

  • Dear sir

    Thanks for your reply, but as i already mentioned i dont want to use adorner layer, i want scaling operation using multi touch. example using 2 fingers i want o scale selected strokes.

     

    I found solution for that is,

    <canvas>

         <inkcanvas> </inkcanvas>

    </canvas>

          when user select strokes, place a temporary rectange at the selected area.

          Using inkcanvas.getselectionbound() property we will get height, width, top , left position of the selected strokes.

          Add rectangle as a child of Canvas and place rectangle with opacity 0.01 over the ink canvas selected area in inkcanvas.selectionchanged event.

     

    apply rendertransform events to rectangle,

             rectangle.isrendertranform = true;

             rectangle.manipulationdelta += .........

    using multi touch scale rectanlge and apply scaleX,scaleY factors to the selected strokes will solve my problem.

    User assume that he is scaling selected strokes using multi touch directly, but actually he is scaling rectangle which is not visible and scaleX,scaleY factors applied to the strokes.

     

     

     

     

     

     


    Thursday, August 4, 2011 7:44 AM

All replies

  •  


    inkcanvas child elements have "IsRenderTransformEnable" property and "ManipulationDelta" events using which i did scaling with multi touch.

    same thing i want to do with inkcanvas "Strokes". ? how ? Strokes doesn't have  "IsRenderTransformEnable" property and "ManipulationDelta" event ?

    Is any other solution where i can do strokes resizing using 2 fingers / multi touch.

    Is any one did "Inkcanvas Strokes resizing using multi touch " ?


    Tuesday, August 2, 2011 6:54 AM
  • Hi ma.taqis,

    WPF InkCanvas's strokes are rendered in AdornerLayer, if you want to rotation, scaling or panning, you have to loop your VisualTree, and then loop the AdornerLayer to get the Stroke, then you could do the rotation, scalling, panning.

    About WPF VisualTree, you could refer to:

    http://www.codeproject.com/KB/WPF/WpfElementTrees.aspx

     

    Best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, August 4, 2011 6:27 AM
    Moderator
  • Dear sir

    Thanks for your reply, but as i already mentioned i dont want to use adorner layer, i want scaling operation using multi touch. example using 2 fingers i want o scale selected strokes.

     

    I found solution for that is,

    <canvas>

         <inkcanvas> </inkcanvas>

    </canvas>

          when user select strokes, place a temporary rectange at the selected area.

          Using inkcanvas.getselectionbound() property we will get height, width, top , left position of the selected strokes.

          Add rectangle as a child of Canvas and place rectangle with opacity 0.01 over the ink canvas selected area in inkcanvas.selectionchanged event.

     

    apply rendertransform events to rectangle,

             rectangle.isrendertranform = true;

             rectangle.manipulationdelta += .........

    using multi touch scale rectanlge and apply scaleX,scaleY factors to the selected strokes will solve my problem.

    User assume that he is scaling selected strokes using multi touch directly, but actually he is scaling rectangle which is not visible and scaleX,scaleY factors applied to the strokes.

     

     

     

     

     

     


    Thursday, August 4, 2011 7:44 AM
  • Dear sir

    Thanks for your reply, but as i already mentioned i dont want to use adorner layer, i want scaling operation using multi touch. example using 2 fingers i want o scale selected strokes.

     

    I found solution for that is,

    <canvas>

         <inkcanvas> </inkcanvas>

    </canvas>

          when user select strokes, place a temporary rectange at the selected area.

          Using inkcanvas.getselectionbound() property we will get height, width, top , left position of the selected strokes.

          Add rectangle as a child of Canvas and place rectangle with opacity 0.01 over the ink canvas selected area in inkcanvas.selectionchanged event.

     

    apply rendertransform events to rectangle,

             rectangle.isrendertranform = true;

             rectangle.manipulationdelta += .........

    using multi touch scale rectanlge and apply scaleX,scaleY factors to the selected strokes will solve my problem.

    User assume that he is scaling selected strokes using multi touch directly, but actually he is scaling rectangle which is not visible and scaleX,scaleY factors applied to the strokes.

     

     

     

     

     

     


    Sorry for commenting in an old post, but can you put some source code example that implements this solution you created?

    I'm struggling to create an inkcanvas simple project that implements multitouch gestures for scaling and rotating, but haven't found anything useful yet...

    Monday, June 8, 2015 1:44 PM