【发布时间】:2014-06-15 22:06:27
【问题描述】:
我正在尝试创建一个外观和感觉与常规 Windows Phone 8 应用程序栏按钮完全相同的按钮。我为此使用 Coding4Fun RoundButton。我的问题是,在设置 ImageSource 时,我无法将图像缩放以正确地适合按钮内部,它太大了。我正在使用来自 Windows Phone 8 SDK 的标准应用程序栏图标图像,其尺寸为 76x76。我还调整了大小以模仿 48x48 的 Windows Phone 7 图标大小,但结果相同。如何调整图像以使其适合 RoundButton?
XAML
<c4f:RoundButton x:Name="browseRoundButton" Click="Browse_Click"/>
XAML.CS
if (Settings.LightTheme.Value)
browseRoundButton.ImageSource = new BitmapImage(new Uri("/Assets/Icons/feature.search.light.png", UriKind.Relative));
else
browseRoundButton.ImageSource = new BitmapImage(new Uri("/Assets/Icons/feature.search.dark.png", UriKind.Relative));
编辑* 在引用 http://www.geekchamp.com/articles/wp7-roundtogglebutton-and-roundbutton-in-depth 和 http://coding4fun.codeplex.com/discussions?searchText=roundbutton 等来源时,我似乎找不到任何解决方案。
【问题讨论】:
标签: c# image xaml button windows-phone-8