如何在WPF C#
中调整菜单和菜单项的图标大小我已经完成了以下
<DockPanel>
<Menu Background="CadetBlue" Height="53" Width="500" IsMainMenu="True" DockPanel.Dock="Top" VerticalAlignment="Top">
<MenuItem Padding="40,0,0,0" Header="File" Foreground="#FF383131" FontSize="20" Background="Beige" Width="100" Height="50" >
<MenuItem.Icon>
<Image Source="/WPFMenuItem;component/Images/garden.jpg" Stretch="Uniform"/>
</MenuItem.Icon>
<MenuItem Header="New" FontSize="20">
<MenuItem.Icon>
<Image Source="/WPFMenuItem;component/Images/garden.jpg" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Exit" FontSize="20">
<MenuItem.Icon>
<Image Source="/WPFMenuItem;component/Images/ic_launch_man.png" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</Menu>
<TextBox />
</DockPanel>
我增加了宽度,高度和边距但是没有用?
答案 0 :(得分:1)
尝试使用渲染变换并设置X和Y刻度。
http://msdn.microsoft.com/en-us/library/ms750596(v=vs.110).aspx
<Image Source="/WPFMenuItem;component/Images/garden.jpg" Stretch="Uniform" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform X="2" Y="3.7"/>
</TransformGroup>
</Image.RenderTransform>
</Image>