在Coding4Fun RoundButton设置的ImageSource不结垢 [英] Setting ImageSource in Coding4Fun RoundButton Not Scaling

查看:138
本文介绍了在Coding4Fun RoundButton设置的ImageSource不结垢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个按钮,是完全相同的外观和感觉作为一个普通的Windows Phone 8应用程序栏按钮。我现在用的是Coding4Fun RoundButton这一点。我的问题是,设置的ImageSource时,无法获得图像缩放到适合正常的按钮里面,这是远远太大。我使用从Windows Phone 8的SDK,界河是76x76标准的应用程序栏图标的图像。我也调整为模仿48×48的Windows Phone 7的图标大小,但相同的结果发生。我该如何调整图像,它在RoundButton恰当地?

I am trying to create a button that is the exact same look and feel as a regular Windows Phone 8 application bar button. I am using the Coding4Fun RoundButton for this. My issue is that when setting the ImageSource I cannot get the image to scale to fit inside of the button properly, it is far too big. I am using a standard application bar icon image from the Windows Phone 8 SDK, whch is 76x76. I've also resized to mimic the Windows Phone 7 icon size of 48x48 but the same result occurs. How can I adjust the image so it fits in the RoundButton properly?

XAML

<c4f:RoundButton x:Name="browseRoundButton" Click="Browse_Click"/>

XAML.CS

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.$c$cplex.com/discussions SEARCHTEXT = roundbutton 我似乎无法找到任何解决方案。

EDIT* In referencing sources like http://www.geekchamp.com/articles/wp7-roundtogglebutton-and-roundbutton-in-depth and http://coding4fun.codeplex.com/discussions?searchText=roundbutton I cannot seem to find any solutions.

推荐答案

我对这个解决方案是设置在XAML中的ImageSource(仅使用黑暗风格的图标),并确保大小为48×48。伟大的工程!

My solution to this was to set the ImageSource in the XAML (using only the dark style icon) and ensure the size is 48x48. Works Great!

这篇关于在Coding4Fun RoundButton设置的ImageSource不结垢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆