Krisztina
Krisztina

Reputation: 83

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

Upvotes: 5

Views: 3220

Answers (1)

Stecya
Stecya

Reputation: 23266

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

Upvotes: 20

Related Questions