2
我有在Scrollviewer
一个Image
...移动影像
<ScrollViewer x:Name="Scrollster" ZoomMode="Enabled" MinZoomFactor="1" MaxZoomFactor="4"
HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" ManipulationMode="All">
<Image x:Name="Img" Source="{x:Bind ImgSource}" Stretch="UniformToFill" PointerPressed="Img_PointerPressed"/>
</ScrollViewer>
我想,当我拖动图像与鼠标指针移动的图像!
我想:
private void Img_PointerPressed(object sender,PointerRoutedEventArgs e)
{
var p = e.Pointer;
}
,但我不能让指针位置改变的ScrollViewer现在的位置。
我的代码有什么问题?我做对了吗?
工作正常,但现在在触摸模式(表和移动)我不能捏缩放放出!有什么问题?我应该问一个新的话题吗? – Shahriar
我相信你需要打开'ManipulationModes.Scale'并手动处理'this.Transform.ScaleX'和'this.Transform.ScaleY'。或者,也许,当有多个联系人时,禁用'ManipulationMode'并让系统处理放大/缩小。 –
现在我知道如何解决它:将系统添加到ManipulationMode将修复它。我的意思是:'ManipulationMode =“TranslateX,TranslateY,System”' – Shahriar