Skip to main content
.NET Framework Class Library
UIElementClip Property

Gets or sets the geometry used to define the outline of the contents of an element. This is a dependency property.

Namespace:   System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)
Public Property Clip As [%$TOPIC/ms588677_en-us_VS_110_1_0_0_0_0%]
public [%$TOPIC/ms588677_en-us_VS_110_1_0_1_0_0%] Clip { get; set; }
property [%$TOPIC/ms588677_en-us_VS_110_1_0_2_0_0%]^ Clip {
	[%$TOPIC/ms588677_en-us_VS_110_1_0_2_0_1%]^ get ();
	void set ([%$TOPIC/ms588677_en-us_VS_110_1_0_2_0_2%]^ value);
member Clip : [%$TOPIC/ms588677_en-us_VS_110_1_0_3_0_0%] with get, set
function get Clip () : [%$TOPIC/ms588677_en-us_VS_110_1_0_4_0_0%] 
function set Clip (value : [%$TOPIC/ms588677_en-us_VS_110_1_0_4_0_1%])

Property Value

Type: System.Windows.MediaGeometry
The geometry to be used for clipping area sizing. The default is a null Geometry.
Dependency Property Information

Identifier field


Metadata properties set to true



Elements outside the geometry will be visually clipped in the rendered layout. The geometry does not have to be rectangular.


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

An object before applying a 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.

  Width="200" Height="150" HorizontalAlignment="Left">
Image with an Elliptical Clip Region

A clipped object

The following example shows how animate a framework element's Clip region. In this 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.

  Width="200" Height="150" HorizontalAlignment="Left">
    <EllipseGeometry x:Name="MyEllipseGeometry1"
    <EventTrigger RoutedEvent="Image.Loaded">
            From="0,0" To="200,150" Duration="0:0:3" RepeatBehavior="Forever" 
            AutoReverse="True" />

For the full sample, see the Clip Region Sample.

Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1