您需要在邊框背景中添加圖像筆刷,並在邊框控件的任意角落四捨五入。這是如何。
<Border HorizontalAlignment="Left" Margin="0" VerticalAlignment="Bottom" Width="100" Height="100" BorderBrush="White" BorderThickness="1"
CacheMode="BitmapCache" CornerRadius="40,0,30,0"><!-- left-top and bottom-right round corners. -->
<Border.Background>
<ImageBrush ImageSource="https://bushrasbrilliantblog.files.wordpress.com/2014/10/placid_nature.jpg" Stretch="Fill"></ImageBrush>
</Border.Background>
</Border>
希望這有助於
編輯寡婦電話雙贏RT 圓角圖像在C#
在這裏,你需要使用的,而不是像
Border border = new Border();
border.Width = 200d;
border.Height = 200d;
border.CornerRadius = new CornerRadius(0, 100, 0, 100);
border.BorderBrush = new SolidColorBrush(Windows.UI.Colors.Green);
border.BorderThickness = new Thickness(2.5d);
ImageBrush img = new ImageBrush();
img.ImageSource = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri("https://bushrasbrilliantblog.files.wordpress.com/2014/10/placid_nature.jpg", UriKind.RelativeOrAbsolute));
img.Stretch = Stretch.Fill;
border.Background = img;
LayoutRoot.Children.Add(border);
但我的ImageBrush使用C#製作了第一張圖片。 –
請參閱編輯C#中的代碼 –