Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image with only two rounded corners in silverlight xaml c#

How I can display images in xaml with only two rounded corners?

<Image x:Name="Image" Height="200" Width="250" Source="image.jpg" Stretch="Fill">
   <Image.Clip>
      <RectangleGeometry RadiusX="20" RadiusY="20" Rect="0,0,250,200"/>
   </Image.Clip>
</Image>

I want only two bottom corner round.

Thanks

like image 907
Krisztina Avatar asked Apr 27 '11 08:04

Krisztina


1 Answers

Use Border for your Image, and specify CornerRadius property

<Grid>
    <Border Height="200" Width="250" CornerRadius="0,0,50,50">
        <Border.Background>
            <ImageBrush ImageSource="Images/Desert.jpg" />
        </Border.Background>
    </Border>
</Grid>

And use image as background brush

Here is example with this xaml. Just change ImageSource

enter image description here

like image 108
Stecya Avatar answered Oct 05 '22 23:10

Stecya