【问题标题】:Setting ImageSource in Coding4Fun RoundButton Not Scaling在 Coding4Fun RoundButton 中设置 ImageSource 不缩放
【发布时间】: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-depthhttp://coding4fun.codeplex.com/discussions?searchText=roundbutton 等来源时,我似乎找不到任何解决方案。

【问题讨论】:

    标签: c# image xaml button windows-phone-8


    【解决方案1】:

    我对此的解决方案是在 XAML 中设置 ImageSource(仅使用深色样式图标)并确保大小为 48x48。效果很好!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-25
      • 2012-09-07
      • 2018-06-22
      • 2021-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多