Here is my button template,
<Microsoft_Windows_Themes:ButtonChrome
x:Name="Chrome"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
RenderDefaulted="{TemplateBinding IsDefaulted}"
RenderMouseOver="{TemplateBinding IsMouseOver}"
RenderPressed="{TemplateBinding IsPressed}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image
Source="{TemplateBinding ImageSource}"
RenderOptions.BitmapScalingMode="NearestNeighbor"
SnapsToDevicePixels="True"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="None"
/>
<ContentPresenter
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
RecognizesAccessKey="True"/>
</Grid>
</Microsoft_Windows_Themes:ButtonChrome>
Now, you can see on this subject https://stackoverflow.com/a/312618/ I tried ..
RenderOptions.BitmapScalingMode="NearestNeighbor"
At all levels, grid, chrome .. and tried various combinations of SnapsToDevicePixels, but the images just don't display correctly. I set Stretch = None, the image is centered, but why is it automatically stretched?
here is the result and its very frustrating.
Bad image in WPF http://akashkava.com/blog/wp-content/uploads/2009/12/BadButton.PNG
16x16, - , Windows Maginifier, , , 20x20, , , 16x16, Stretch = None, - , ?