0

I am making a WPF application following MVVM pattern. In application i am displaying some icons. Here is my code.

XAML

<Image Margin="2" Source="{Binding Icon1}" Height="16px" Width="16px" />
<Image Margin="2" Source="{Binding Icon2}" Height="16px" Width="16px" />
<Image Margin="2" Source="{Binding Icon3}" Height="16px" Width="16px" />

And here is ViewModel.

public string Icon1 { get { return @"C:\MyIcons\Icon1.ico"; }  }
public string Icon2 { get { return @"C:\MyIcons\Icon2.ico"; }  }
public string Icon3 { get { return @"C:\MyIcons\Icon3.ico"; }  }

Application is working fine and I am able to see the icons. Icon file contains icons for different resolutions (64x64, 32x32, 16x16). Application is showing me 48x48 icon. Since I don't need such huge icons I want that instead of getting 64x64 icon i get 16x16 icon. What should I do. How I get a specific resolution icon from icon file path.

fhnaseer
  • 7,159
  • 16
  • 60
  • 112
  • 1
    Possible duplicate question http://stackoverflow.com/questions/952080/how-do-you-select-the-right-size-icon-from-a-multi-resolution-ico-file-in-wpf – Magnus Eklund Oct 11 '12 at 10:00

1 Answers1

0

Here's a similar topic that might help you find what you're looking for:

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

Community
  • 1
  • 1
Andrew
  • 815
  • 8
  • 17