I have multiple buttons, each having a 32×32 pixels PNG image. The strange thing is, that both buttons show different sizes (Yes, I triple checked that icons are really 32×32!). The seconds button looks like as it would be 48×48 pixels in size. The funniest thing is, if I omit the Stretch="None" attribute, the icons are scaled up to fill nearly the whole screen.
I cannot explain myself why this is happening!
<ToolBar Name="toolBar1" DockPanel.Dock="Top">
<Button Name="importButton" ToolTip="Import" Click="importButton_Click">
<Image Source="Icons/Import.png" Stretch="None" />
</Button>
<Button Name="toggleDetails" ToolTip="Details for Item" Click="toggleDetails_Click">
<Image Source="Icons/maximize.png" Stretch="None" />
</Button>
</ToolBar>
<StackPanel Name="stackPanel1" DockPanel.Dock="Top" Orientation="Horizontal" Margin="0,5,0,5">
<Label Name="label2" Content="Find"></Label>
<TextBox Name="tags" Width="400" KeyDown="tags_KeyDown" />
<Button ToolTip="Find" Name="findItemsButton" Click="findItemsButton_Click">
<Image Source="Icons/xmag.png" Stretch="None" />
</Button>
<CheckBox Content="Show Closed" Name="showClosedItemsCheckBox" VerticalAlignment="Center" Margin="10,0,0,0" Click="showClosedItemsCheckBox_Click" />
</StackPanel>
<TabControl Name="tabControl" TabStripPlacement="Top">
</TabControl>
</DockPanel>
The two images probably have different DPIs.