<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Background="Black"> <Border BorderThickness="3" BorderBrush="Yellow" CornerRadius="10" Padding="2" HorizontalAlignment="Center" VerticalAlignment="Center"> <Grid> <Border Name="mask" Background="White" CornerRadius="7"/> <StackPanel> <StackPanel.OpacityMask> <VisualBrush Visual="{Binding ElementName=mask}"/> </StackPanel.OpacityMask> <Image Source="http://chriscavanagh.files.wordpress.com/2006/12/chriss-blog-banner.jpg"/> <Rectangle Height="50" Fill="Red"/> <Rectangle Height="50" Fill="White"/> <Rectangle Height="50" Fill="Blue"/> </StackPanel> </Grid> </Border> </Page>
This WPF XAML is Lightweight rounded corners for anything , but it doesn't work. me = (
<Border Canvas.Left="55" Canvas.Top="30" Width="100" Height="Auto" Margin="12,12,8,0" VerticalAlignment="Top" BorderBrush="#FF3B5998" BorderThickness=".5" CornerRadius="18"> <Border.Effect> <DropShadowEffect BlurRadius="5" Opacity=".5" ShadowDepth="3" /> </Border.Effect> <Border Name="ReceiverColor" BorderBrush="#FF96B2E4" BorderThickness="6" CornerRadius="15"> <Border Name="Mask" BorderBrush="#FF3B5998" BorderThickness=".5" CornerRadius="13"> <StackPanel> <StackPanel.OpacityMask> <VisualBrush Visual="{Binding ElementName=Mask}" /> </StackPanel.OpacityMask> <Image Name="Receiver" /> </StackPanel> </Border> </Border> </Border>
--- EDIT ---
I make border sizes automatic and change image source to image from link
when the size of the loaded border of the window becomes the size of the image, but the image is not displayed !!!
source share