如何为 Xamarin Forms 项目快速创建不同大小的图像?

How to quickly create difference sizes of images for a Xamarin Forms project?

我刚开始学习 Xamarin Forms。我注意到在一些开源项目中有一些名为 logo.pnglogo@2x.pnglogo@4x.png 的图像。通常这些图像是如何创建的?

结帐 Resizetizer NT,它会自动为您调整图标大小。

  1. 安装the NuGet
  2. 将您的图片(PNG 或 SVG)添加到您的共享项目中,类型为 SharedImage
  3. 在共享项目的 csproj 文件中为每个图像设置基本尺寸(见下文)
    <ItemGroup>
        <SharedImage Include="xamagon.svg" BaseSize="60,60" />
    </ItemGroup>

查看 the link 了解更多详细步骤。