Windows 8 24x24 badge logo image failing wac tool test

喜夏-厌秋 提交于 2019-12-06 23:45:19

问题


I am developing windows 8 app using tool Microsoft Visual Studio Express for Windows 8 When I am creating app packages to upload on app store it fails the WAC tool test and gives out following error.

Image reference "images\badge_24.png": The image "C:\Program Files\WindowsApps
\myproject\images\badge_24.png" has an ABGR value "0x1D5E50E9" at position (9, 0) 
that is not valid. The pixel must be white (##FFFFFF) or transparent (00######).

I searched on net and found the link Badge Issue in VS update 1

I am not using 34x34 image for badge logo. I am using 24x24 image still I am getting the error by wac tool due which I can not submit this to App Store.

I tried with using 34x34 image but its not working can any one help me with this?


回答1:


I know this problem very well. It is not related to the image size but to the image content. The error message is actually very precise - not all pixels in your badge logo fulfill the requirement that they are fully white ##FFFFFF or transparent 00######.

I suggest your first step is a confirmation that my answer is right. For that purpose just create a temporary 24x24 image which would be completely white. If you use this temp white logo the WAC should pass.

Next step would be to get a proper logo image. I did the following with GIMP graphic tool (http://www.gimp.org/downloads/):

  1. Identify background color of your logo, navigate to Colors > Color to alpha and select the identified color. That makes your background transparent.
  2. Now it's time to desaturate the whole picture by Colors > Desaturate
  3. Restrict bits to ##FFFFFF and 00###### only: Navigate to Colors > Brightness-Contrast and set both Brightness and Contrast to the max values.

To be sure, I am right you might want to attach your current badge logo to your original question.




回答2:


The solution is really simple! Just import your badge logo into Adode Photoshop and Press [Control + L] or Go to the menu [Image> Adjustments> Levels] and set the values as:

Channel: RGB Input Levels up fields: 253; 1,00; 255 Input Levels down fields: 255; 255

Save your image!

Afterward, just redo do process of creating App Packages on visual Studio. Now Enjoy you app approved!




回答3:


One way to automate the process is to write a litte C# console application that "fixes" the images:

Add a nuget reference to package Magick.NET.Core-Q8
Perform the following code to remove < 255 color channels:

foreach( string ThisFile in Directory.GetFiles( @"C:\YourUwpApplication\Assets", "LockScreenLogo.*.png" ) )
{
    using( ImageMagick.MagickImage TheImage = new ImageMagick.MagickImage( ThisFile ) )
    {
        ImageMagick.PixelCollection Pixels = TheImage.GetPixels();

        for( int IX = 0; IX < TheImage.Width; IX++ )
        {
            for( int IY = 0; IY < TheImage.Height; IY++ )
            {
                Pixels[ IX, IY ].SetChannel( 0, 255 );
                Pixels[ IX, IY ].SetChannel( 1, 255 );
                Pixels[ IX, IY ].SetChannel( 2, 255 );
            }
        }

        TheImage.Write( ThisFile );
    }
}

Enjoy
-Simon




回答4:


Possible option (worked for me) remove:

<uap:LockScreen Notification="badgeAndTileText" BadgeLogo="" />

from Package.appxmanifest file (as xml)

If the app has nothing to do with LockScreen notifications, this seems to be an option.



来源:https://stackoverflow.com/questions/14581782/windows-8-24x24-badge-logo-image-failing-wac-tool-test

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!