UIElement.Clip Property
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
'Declaration Public Property Clip As Geometry 'Usage Dim instance As UIElement Dim value As Geometry value = instance.Clip instance.Clip = value
/** @property */ public Geometry get_Clip () /** @property */ public void set_Clip (Geometry value)
public function get Clip () : Geometry public function set Clip (value : Geometry)
For XAML information, see the Geometry type.
Property Value
The geometry to be used for clipping area sizing. The default is a null Geometry.This example shows how to define a framework element's Clip region. To define a clip, use a Geometry (for example, an EllipseGeometry to set the element's Clip property. Only the area that is within the region of the geometry will be visible.
The following example shows an Image element without a defined clip region. Because no clip region is defined, the entire image is displayed.
<Image Source="sampleImages\Waterlilies.jpg" Width="200" Height="150" HorizontalAlignment="Left" />
Image with No Clip Region
In the next example, an identical Image is created, except that it has a defined clip region. Only the part of the image that is within the area the EllipseGeometry will be displayed.
<Image Source="sampleImages\Waterlilies.jpg" Width="200" Height="150" HorizontalAlignment="Left"> <Image.Clip> <EllipseGeometry RadiusX="100" RadiusY="75" Center="100,75"/> </Image.Clip> </Image>
Image with an Elliptical Clip Region
More Code
| How to: Animate a Clip Region | This example shows how animate a framework element's Clip region. In the following example, an EllipseGeometry is used to define an elliptical clip region for an Image element. A PointAnimation animates the ellipse geometry's Center property from (0, 0) to (200, 150). The animation starts playing after the image is loaded and repeats indefinitely. |
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.