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.