编辑:经过大量的搜索,我发现这个问题的最佳解决方案是使用@wdavo提取的ClipPingBehavior,谢谢!真正的问题是不知道图像的尺寸.如果您知道尺寸,那么有很多简单的开箱即用解决方案.
解决方法 您可以使用此剪切行为http://expressionblend.codeplex.com/SourceControl/changeset/view/61176#494852
您需要安装Expression Blend SDK
<UserControlx:Class="RoundedCorners.MainPage"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/Expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:behaviors="clr-namespace:Expression.Samples.Interactivity"xmlns:i="clr-namespace:System.windows.Interactivity;assembly=System.windows.Interactivity"mc:Ignorable="d"d:DesignHeight="800"d:DesignWIDth="800"><GrID x:name="LayoutRoot" Background="White" margin="50"> <GrID Background="lightGreen"> <GrID.RowDeFinitions> <RowDeFinition /> <RowDeFinition Height="auto" /> </GrID.RowDeFinitions> <i:Interaction.Behaviors> <behaviors:ClipPingBehavior CornerRadius="30" /> </i:Interaction.Behaviors> <Image GrID.Row="0" Stretch="Fill" Source="Image.JPG" /> <StackPanel GrID.Row="1"> <TextBlock Text="Hello" /> <TextBlock Text="World" /> </StackPanel> </GrID></GrID>总结
以上是内存溢出为你收集整理的Silverlight Rounding Corners全部内容,希望文章能够帮你解决Silverlight Rounding Corners所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)