gpt4 book ai didi

windows-10 - 为什么 makepri.exe 创建多个 Resources.pri 文件?

转载 作者:行者123 更新时间:2023-12-02 18:23:43 31 4
gpt4 key购买 nike

我正在尝试创建一个 Resources.pri 文件,以便 Windows 10 知道在不同分辨率下将哪些图像用于我的开始磁贴。我正在执行下面链接的 MSDN 文档的第 6 步:

https://msdn.microsoft.com/en-us/library/windows/apps/dn393983.aspx#Specify_images_for_scaling__localization__and_high_contrast

我的所有 Logo 图像都根据其比例进行了标记。这些是我的 Assets 文件夹中的名称:

70x70Logo.scale-80.png
70x70Logo.scale-100.png
70x70Logo.scale-140.png
70x70Logo.scale-180.png
150x150Logo.scale-80.png
150x150Logo.scale-100.png
150x150Logo.scale-140.png
150x150Logo.scale-180.png

当我手动使用 makepri.exe 时,它​​会创建三个 Resources.pri 文件,而不是仅一个,其中包含我想要的所有缩放信息。这些是生成的文件:

Resources.pri
Resources.scale-140.pri
Resources.scale-180.pri

Resources.pri 包含 80% 和 100% 比例的信息,但其他两个文件包含 140% 和 180% 比例的信息。知道为什么较大的比例被分成单独的文件吗?我在下面包含了我的 TestAppConfig.xml 文件以及我用来生成文件的命令。

TestAppConfig.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources targetOsVersion="10.0.0" majorVersion="1">
<packaging>
<autoResourcePackage qualifier="Language"/>
<autoResourcePackage qualifier="Scale"/>
<autoResourcePackage qualifier="DXFeatureLevel"/>
</packaging>
<index root="\" startIndexAt="\">
<default>
<qualifier name="Language" value="en-US"/>
<qualifier name="scale" value="100"/>
</default>
<indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="."/>
<indexer-config type="resw" convertDotsToSlashes="true" initialPath=""/>
<indexer-config type="resjson" initialPath=""/>
<indexer-config type="PRI"/>
</index>
<!--<index startIndexAt="Start Index Here" root="Root Here">-->
<!-- <indexer-config type="resfiles" qualifierDelimiter="."/>-->
<!-- <indexer-config type="priinfo" emitStrings="true" emitPaths="true" emitEmbeddedData="true"/>-->
<!--</index>-->
</resources>

创建 TestAppConfig.xml 的命令

"C:\Program Files (x86)\Windows Kits\10\bin\x86\makepri.exe" createconfig /cf %USERPROFILE%\Documents\TestAppConfig.xml /dq lang-en-US_scale-100_contrast-high /pv 10.0.0

创建 Resources.pri 的命令

"C:\Program Files (x86)\Windows Kits\10\bin\x86\makepri.exe" new /pr %USERPROFILE%\Documents\CreateResources /cf %USERPROFILE%\Documents\TestAppConfig.xml /in TestApp /of %USERPROFILE%\Documents\CreateResources\Resources.pri

非常感谢对此的任何见解!如果我可以提供更多详细信息,请告诉我。

最佳答案

我最终找到了一种解决方案,尽管我完全确定为什么它可以工作/需要创建一个 Resources.pri 文件。我发现设置所有图像的默认语言允许 makepri.exe 将所有图像比例作为资源候选添加到一个 Resources.pri 文件中。例如,我发现这个文件结构有效:

\Assets
\en-US
70x70Logo.scale-80.png
70x70Logo.scale-100.png
70x70Logo.scale-140.png
70x70Logo.scale-180.png
150x150Logo.scale-80.png
150x150Logo.scale-100.png
150x150Logo.scale-140.png
150x150Logo.scale-180.png

这段文档片段给了我线索:

Note We recommend that you mark the default language on string resource files (such as en-US\resources.resw) and the default scale on images (such as logo.scale-100.png), even if these files will not be localized nor multiple resolution images provided

https://msdn.microsoft.com/en-us/library/windows/apps/hh965372.aspx

想想看。

我希望其他人觉得这有帮助。如果有人对 makepri.exe 为何以这种方式工作有更多见解,我很想了解更多信息。

关于windows-10 - 为什么 makepri.exe 创建多个 Resources.pri 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38506783/

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