Open tmyt opened 4 years ago
Image control is not rendering properly inside ScrollViewer after change ZoomFactor use ScrollViewer.ChangeView().
ScrollViewer.ChangeView()
Render scaled Image inside ScrollViewer.
<Page x:Class="UnoApp5.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <ScrollViewer ZoomMode="Enabled" x:Name="scrollViewer"> <Image Source="https://images.pexels.com/photos/3651611/pexels-photo-3651611.jpeg" ImageOpened="Image_OnImageOpened"/> </ScrollViewer> </Grid> </Page>
using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; namespace UnoApp5 { public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); } private void Image_OnImageOpened(object sender, RoutedEventArgs e) { scrollViewer.ChangeView(0, 0, 0.5f); } } }
Nuget Package:
Package Version(s):
Affected platform(s):
Visual Studio:
Relevant plugins:
This needs to be re-evaluated after https://github.com/unoplatform/uno/pull/18261/
Current behavior
Image control is not rendering properly inside ScrollViewer after change ZoomFactor use
ScrollViewer.ChangeView()
.Expected behavior
Render scaled Image inside ScrollViewer.
How to reproduce it (as minimally and precisely as possible)
Environment
Nuget Package:
Package Version(s):
Affected platform(s):
Visual Studio:
Relevant plugins:
Anything else we need to know?