svg 图像正在缩放而不是扩展

问题描述 投票:0回答:1
<Canvas Background="AliceBlue">
    <TextBlock x:Name="MessageBox" Text="Press the black holder and drag to change Size" FontWeight="Bold" FontSize="13"/>
    <TextBlock x:Name="Height_block"></TextBlock>
    <TextBlock x:Name="Width_block"></TextBlock>
    <Border x:Name="Holder" Height="8" Width="8" Background="Black"/>
    <Border x:Name="border" BorderThickness="2" BorderBrush="Purple">
        <Image x:Name="image" Source="{StaticResource svg_source}" />
    </Border>
    

</Canvas>

我已将 svg 作为子项添加到边框,并将其高度和宽度设置为边框的高度和宽度,但图像正在缩放而不是扩展。我已将 svg 的高度和宽度属性设置为自动,我应该做什么做

如何将 svg 扩展至给定高度enter image description here

c# uwp
1个回答
0
投票

UWP 支持 SVG 图像,应用程序布局将决定 SVG 解码的适当大小。建议检查一下你的

svg_source
,svg中是否设置了宽度和高度。 https://i.stack.imgur.com/bw3iU.png。如果已经设置,建议您删除。

© www.soinside.com 2019 - 2024. All rights reserved.