How do you select the right size icon from a multi-resolution .ico file in WPF?

后端 未结 4 1183
盖世英雄少女心
盖世英雄少女心 2020-12-05 00:17

If I have a multi-resolution icon file (.ico), how can I insure that WPF picks the right sized one? Does setting the width and height of the Image force it, or does WPF simp

4条回答
  •  情歌与酒
    2020-12-05 01:11

    If the reason you're asking is that the icon looks blurry to you, check out this very good article on the topic that I used to solve that problem: http://blogs.msdn.com/dwayneneed/archive/2007/10/05/blurry-bitmaps.aspx

    You will have to use a custom control that not only sizes the icon exactly, but ensures that it coincides exactly with the pixel grid. Only then will you avoid interpolation and therefore blurriness.

    Trying to find some info on your query about image size selection in icons...will post back if I find any...

提交回复
热议问题