将所有图像添加到Package.AppXManifest会导致编译器警告 [英] Adding all images to the Package.AppXManifest results in a compiler warning
问题描述
我在Windows 8 Store项目的Package.appxmanifest
设置中为小徽标"指定了win8_logo_small.png
.创建商店包装时,会收到以下警告:
I have specified win8_logo_small.png
for the "Small logo" in the Package.appxmanifest
setting of my Windows 8 Store project. When I create a store package, I get this warning:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets(1052,9):
warning APPX1621: A mixture of images matching logical name 'win8_logo_small.png' exists
in this project with and without the "scale" or "targetsize" qualifier specified.
For predictable runtime behavior, explicitly specify the scale or target size
in each image asset's file name.
尽管这仅仅是警告,但我想知道微软要我做什么,因为图像比例变体的名称是自动生成的:
Although this is a mere warning, I'd like to know what Microsoft wants me to do about it because the names for the image scale variants are auto-generated:
win8_logo_small.scale-80.png
win8_logo_small.scale-100.png
...
win8_logo_small.targetsize-16.png
win8_logo_small.targetsize-32.png
如果我将xxx.targetsize
文件重命名为xxx.scale-###.png
之类并将其添加到项目中,Visual Studio会自动将文件复制到xxx.targetsize-##.png
!
If I rename the xxx.targetsize
files to something like xxx.scale-###.png
and add it to the project, Visual Studio automatically copies the file to a xxx.targetsize-##.png
!
这可以解决吗?它需要解决还是仅仅是Windows RT软件包编译器中的错误?
Is this something that can be solved? Does it need solving or is it just a bug in the Windows RT package compiler?
推荐答案
缩放图像和目标尺寸图像应互斥.来自如何使用限定符命名资源
The scale and targetsize images should be mutually exclusive. From How to name resources using qualifiers
targetsize限定符可以指定特定大小的资源 (以像素为单位).它主要用于指定文件类型关联 图标或协议图标显示在桌面Windows资源管理器中.这 限定词通常用于正方形图像或图标,并指定 仅单个图像尺寸.要求 资源(ResourceContext.QualifierValues)必须显式指定一个 目标尺寸.没有默认值. 如果您使用targetsize限定词 在资源上,您不应使用规模限定符.
The targetsize qualifier can specify resources at a particular size (in pixels). It is primarily used to specify file type association icons or protocol icons shown in the desktop Windows Explorer. This qualifier is typically used for square images or icons and specifies only a single image dimension. The system or app requesting the resource (ResourceContext.QualifierValues) must explicitly specify a targetsize. There is no default. If you use the targetsize qualifier on a resource, you should not use the scale qualifier.
Visual Studio对此可能会更加清楚,因为应用程序清单UI暗示您可以/应该提供所有这些内容.
Visual Studio could be a bit more clear about this, agreed, since the app manifest UI implies you could/should supply all of them.
这篇关于将所有图像添加到Package.AppXManifest会导致编译器警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!