I am developing a Windows Phone 8 App based on SVG Images which is a combination of different 'PATHS'.
Now I want to Zoom and Pan that PATHS simultaneously which are inside a Canvas, So how can we Zoom & Pan multiple objects inside a Grid/Canvas/Stack etc... programmatically
These paths create an image. See the sample data
enter code here
`<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Name="Layer_1" Width="460" Height="590" Canvas.Left="0" Canvas.Top="0"> <Canvas.RenderTransform> <TranslateTransform X="0" Y="0"/> </Canvas.RenderTransform> <Canvas Name="g3"> <Canvas.RenderTransform> <MatrixTransform Matrix="3.2391246 0 0 3.2391246 -753.98107 -998.9346"/> </Canvas.RenderTransform> <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path141" Fill="#FFFFFFFF" Data="m 322.182 375.036 c 1.094 -0.761 2.516 -1.75 4.011 -2.79 0 1.84 0 3.837 0 5.722 -1.4 -1.022 -2.826 -2.065 -4.011 -2.932 z"/> <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path143" Fill="#FFFFFFFF" Data="m 282.119 364.334 c 1.051 1.598 1.981 3.013 2.778 4.224 -1.328 0.392 -2.958 0.874 -4.806 1.419 0.669 -1.861 1.347 -3.746 2.028 -5.643 z"/> <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path145" Fill="#FFFFFFFF" Data="m 301.865 398.572 c -1.954 -0.354 -3.921 -0.708 -5.827 -1.052 1.38 -1.32 2.654 -2.539 3.707 -3.546 0.547 1.186 1.283 2.784 2.12 4.598 z"/> <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path147" Fill="#FFFFFFFF" Data="m 312.675 391.751 c 1.302 0.568 2.861 1.249 4.609 2.012 -1.747 1.014 -3.478 2.018 -5.207 3.022 0.219 -1.848 0.423 -3.565 0.598 -5.034 z"/> <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path149" Fill="#FFFFFFFF" Data="m 299.682 356.375 c -0.922 -0.954 -2.165 -2.238 -3.563 -3.683 1.845 -0.336 3.8 -0.692 5.682 -1.035 -0.82 1.823 -1.561 3.475 -2.119 4.718 z"/>
`
答案 0 :(得分:0)
专家。我解决了这个问题。
请记住,无论何时UI控件都是网格/画布/堆栈等的子级...然后在主网格/画布/堆栈上应用缩放功能将适用于所有内部子项。
所以我在Canvas中使用了WPToolkit组件Manipulation_Delta,Flicker,Drag_Delta等事件,然后SVG(路径)完美地缩放和平移。
这太棒了。