What size and format should the WPF MenuItem Icon be?
What size and format should the WPI MenuItem have?
Now I have
<ContextMenu>
<MenuItem Header="Camera">
<MenuItem.Icon>
<Image Source="images/camera.png" />
</MenuItem.Icon>
But in the menu, the icon spills over the edge, which looks bad.
Frustratingly, the docs do not provide this information. System.Windows.Controls.MenuItem.Icon
+3
source to share
2 answers
this is the code:
<MenuItem>
<MenuItem.Header>
<StackPanel>
<Image Width="20" Height="20" Source="PATH to your image" />
</StackPanel>
</MenuItem.Header>
</MenuItem>
You can also try to stretch Image.Stretch Property
0
source to share