Quality of the search result images in Metro Search Charm

為{幸葍}努か 提交于 2019-12-11 08:17:30

问题


This should be a trivial one, it's maybe only my bad day ;) I use 40x40px images for showing the type of the search results. If I use exactly the same images in my main app they are shown correctly. If I use them in the search charm their quality is drastically decreased.

What am I doing wrong? I tried another sizes, another picture formats, still the same. I tried another image (photo below) and that one looks OK. Why is only my circle based icon so deformed?


回答1:


It sounds like this could be related to automatic scaling of the images. Windows will automatically scale up/down based on pixel density, and you can help things scale well by either using vector-based images or, for bitmap images, supplying scale-specific versions.

For example, to scale an image referenced in markup as "AppLogo.jpg", you'd include these images:

  • AppLogo.scale-100.jpg
  • AppLogo.scale-140.jpg
  • AppLogo.scale-180.jpg

You can also use folders, e.g. "\scale-140\AppLogo.jpg".

For search result images, the 100% image is the 40x40 pixel version, 140 is 56x56, and 180 is 72x72. Just reference the image as "AppLogo.jpg" and the appropriate version will be used automatically. (You can also detect scale with DisplayProperties.ResolutionScale and manually choose an image.)

Here's a couple of articles with more examples/details:

  • "Guidelines for scaling to pixel density"
  • "Quickstart: Using file or image resources"

There's also some scaling discussion in the forums (general, not specific to search) here and here.




回答2:


It does not happen that often but it seems the right solution in this case was simply to wait ;) In this case it took exactly 3 months, which is not that quick, however timing is perfect - just before official Win8 launch. I haven't done anything new regarding result suggestion images in my solution and today I realized that the images became crisp. Probably fixed by any of the windows update.



来源:https://stackoverflow.com/questions/11589999/quality-of-the-search-result-images-in-metro-search-charm

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