Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

  • fatihpiristine

    fatihpiristine

    Member

    8 Points

    4 Posts

    Re: c# clip property

    May 08, 2008 01:15 PM | LINK

                RectangleGeometry xRect = new RectangleGeometry();
                xRect.Rect = new Rect(100, 100, 100, 100);
                xRect.RadiusX = 20;
                xRect.RadiusY = 20;

                Image xImage = new Image();
                xImage.Source = new BitmapImage(new Uri("1.jpg", UriKind.Relative));
                xImage.Stretch = Stretch.Fill;
                xImage.Width = 300;
                xImage.Height = 200;

                xImage.Clip = xRect;

                LayoutRoot.Children.Add(xImage);

    This one works for images