我必须在uwp应用程序中放大图像,这很好,但设计需要在其前面有另一个图像(作为按钮),我不希望该元素被缩放以及。它只能是画布标签内的图像,这就是我现在拥有的图像。scrollviewer只能放大一个元素
<ScrollViewer MinZoomFactor="1"
ZoomMode="Enabled"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto">
<RelativePanel HorizontalAlignment = "Stretch" >
<Canvas x:Name="canvas">
<Image Source = "{Binding Test,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
</Canvas >
<Button RelativePanel.AlignTopWithPanel="True"
Height="55"
Command="{Binding Path=CollapseSplitView}"
CommandParameter="{Binding ElementName=SplitV}">
<Button.Background>
<ImageBrush ImageSource = "/Assets/btlist.png" ></ ImageBrush >
</Button.Background >
</Button >
<Image RelativePanel.AlignBottomWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
Source="/Assets/escala-x.png"
Width="130"
Height="70"
Margin="0,0,20,0"
ScrollViewer.IsZoomChainingEnabled="False"
ScrollViewer.IsZoomInertiaEnabled="False">
</Image>
</RelativePanel>
</ScrollViewer>
这就是我所拥有的xaml,它使缩放工作适用于它内部的所有元素。我试图设置scrollViewer.zoomMode =禁用不在画布中但没有运气的元素。有任何想法吗?谢谢!
有三个图像......哪一个放大,哪个不放? –
@JustinXL,对不起,我没有提到过。只是在画布内的一个 – marsalal1014