gpt4 book ai didi

c# - 在不损失质量的情况下在 xaml 中调整图像大小

转载 作者:IT王子 更新时间:2023-10-29 03:59:16 26 4
gpt4 key购买 nike

我有这张图片(原始尺寸:256x256)

enter image description here

我做了这个 xaml 定义来在我的应用程序中显示图像

<Image Grid.Row="1" 
Source="/MyProject;component/Images/happy.png"
Stretch="Fill"
Width="64" Height="64"
VerticalAlignment="Top" Margin="0,0,0,0"
HorizontalAlignment="Center" />

我得到了这个结果

enter image description here

我怎样才能更平滑地调整大小?

最佳答案

在您的图像中包含 RenderOptions.BitmapScalingMode="Fant",如下所示:

<Image Grid.Row="1"
Source="/MyProject;component/Images/happy.png"
RenderOptions.BitmapScalingMode="Fant"
Stretch="Fill"
Width="64"
Height="64"
VerticalAlignment="Top"
Margin="0,0,0,0"
HorizontalAlignment="Center" />

关于c# - 在不损失质量的情况下在 xaml 中调整图像大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19302061/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com