Fix sidebar image scaling

This commit is contained in:
Megalon 2020-02-18 15:27:57 -08:00
parent d121c02336
commit 4ca4e53890
7 changed files with 6 additions and 10 deletions

View file

@ -216,7 +216,7 @@ namespace ModAssistant
sidebar = new BitmapImage(new Uri(Path.Combine(location, name + ".side.png"))); sidebar = new BitmapImage(new Uri(Path.Combine(location, name + ".side.png")));
} }
MainWindow.Instance.BackgroundImage.ImageSource = background; MainWindow.Instance.BackgroundImage.ImageSource = background;
MainWindow.Instance.SideImage.ImageSource = sidebar; MainWindow.Instance.SideImage.Source = sidebar;
} }
/// <summary> /// <summary>

View file

@ -15,11 +15,7 @@
<ImageBrush x:Name="BackgroundImage" Stretch="{DynamicResource BackgroundImageStretch}"/> <ImageBrush x:Name="BackgroundImage" Stretch="{DynamicResource BackgroundImageStretch}"/>
</Rectangle.Fill> </Rectangle.Fill>
</Rectangle> </Rectangle>
<Rectangle> <Image x:Name="SideImage" UseLayoutRounding="True" SnapsToDevicePixels="True" HorizontalAlignment="Left" VerticalAlignment="{DynamicResource SideImageYPosition}" Width="1272" Height="689" Stretch="Fill"/>
<Rectangle.Fill>
<ImageBrush x:Name="SideImage" Stretch="None" AlignmentX="Left" AlignmentY="{DynamicResource SideImageYPosition}"/>
</Rectangle.Fill>
</Rectangle>
<Grid Margin="10"> <Grid Margin="10">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -75,6 +75,6 @@
<!--Background and Side image settings.--> <!--Background and Side image settings.-->
<Stretch x:Key="BackgroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill --> <Stretch x:Key="BackgroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill -->
<AlignmentY x:Key="SideImageYPosition">Bottom</AlignmentY> <!-- Bottom, Center, Top --> <VerticalAlignment x:Key="SideImageYPosition">Bottom</VerticalAlignment> <!-- Bottom, Center, Top -->
</ResourceDictionary> </ResourceDictionary>

View file

@ -63,6 +63,6 @@
<!-- Background and Side image settings. --> <!-- Background and Side image settings. -->
<Stretch x:Key="BackgroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill --> <Stretch x:Key="BackgroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill -->
<AlignmentY x:Key="SideImageYPosition">Bottom</AlignmentY> <!-- Bottom, Center, Top --> <VerticalAlignment x:Key="SideImageYPosition">Bottom</VerticalAlignment> <!-- Bottom, Center, Top -->
</ResourceDictionary> </ResourceDictionary>

View file

@ -74,6 +74,6 @@
<!--Background and Side image settings.--> <!--Background and Side image settings.-->
<Stretch x:Key="BackgroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill --> <Stretch x:Key="BackgroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill -->
<AlignmentY x:Key="SideImageYPosition">Bottom</AlignmentY> <!-- Bottom, Center, Top --> <VerticalAlignment x:Key="SideImageYPosition">Bottom</VerticalAlignment> <!-- Bottom, Center, Top -->
</ResourceDictionary> </ResourceDictionary>

View file

@ -90,6 +90,6 @@
<SolidColorBrush x:Key="OptionsIconColor" Color="{DynamicResource ResourceKey=StandardIcon}"/> <SolidColorBrush x:Key="OptionsIconColor" Color="{DynamicResource ResourceKey=StandardIcon}"/>
<Stretch x:Key="BackgroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill --> <Stretch x:Key="BackgroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill -->
<AlignmentY x:Key="SideImageYPosition">Bottom</AlignmentY> <!-- Bottom, Center, Top --> <VerticalAlignment x:Key="SideImageYPosition">Bottom</VerticalAlignment> <!-- Bottom, Center, Top -->
</ResourceDictionary> </ResourceDictionary>