如何同时缩放和平移 Canvas 内的多个对象 - Windows Phone 8
How to Zoom & Pan Multiple Objects inside Canvas simultaneously - Windows Phone 8
我正在开发 Windows Phone 8 个基于 SVG 图像的应用程序,它是不同 'PATHS'.
的组合
现在我想同时缩放和平移 Canvas 中的 PATHS,那么我们如何缩放和平移 Grid/Canvas/Stack 中的多个对象等等...以编程方式
这些路径创建一个图像。查看示例数据
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"/>
`
伙计们。我解决了这个问题。
请记住,每当 UI 控件是 Grid/Canvas/Stack 等的子控件时...然后在 Main Grid/Canvas/Stack 上应用缩放功能将应用于所有内部子控件.
所以我在 Canvas 中使用了 WPToolkit 组件 Manipulation_Delta、Flicker、Drag_Delta 等事件,然后完美地缩放和平移了 SVG(路径)。
这太棒了。
我正在开发 Windows Phone 8 个基于 SVG 图像的应用程序,它是不同 'PATHS'.
的组合现在我想同时缩放和平移 Canvas 中的 PATHS,那么我们如何缩放和平移 Grid/Canvas/Stack 中的多个对象等等...以编程方式
这些路径创建一个图像。查看示例数据
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"/>
`
伙计们。我解决了这个问题。
请记住,每当 UI 控件是 Grid/Canvas/Stack 等的子控件时...然后在 Main Grid/Canvas/Stack 上应用缩放功能将应用于所有内部子控件.
所以我在 Canvas 中使用了 WPToolkit 组件 Manipulation_Delta、Flicker、Drag_Delta 等事件,然后完美地缩放和平移了 SVG(路径)。
这太棒了。