UIElement.Clip 속성
정의
요소 내용의 윤곽선을 정의하는 데 사용할 기하 도형을 가져오거나 설정합니다.Gets or sets the geometry used to define the outline of the contents of an element. 이 속성은 종속성 속성입니다.This is a dependency property.
public:
property System::Windows::Media::Geometry ^ Clip { System::Windows::Media::Geometry ^ get(); void set(System::Windows::Media::Geometry ^ value); };
public System.Windows.Media.Geometry Clip { get; set; }
member this.Clip : System.Windows.Media.Geometry with get, set
Public Property Clip As Geometry
속성 값
클리핑 영역 크기 조정에 사용할 기하 도형입니다.The geometry to be used for clipping area sizing. 기본값은 null Geometry입니다.The default is a null Geometry.
예제
이 예제에서는 프레임 워크 요소의 영역을 정의 하는 방법을 보여 줍니다 Clip .This example shows how to define a framework element's Clip region. 클립을 정의 하려면를 사용 Geometry 합니다. 예를 들어,를 사용 EllipseGeometry 하 여 요소의 속성을 설정 Clip 합니다.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.
다음 예제에서는 Image 정의 된 클립 영역이 없는 요소를 보여 줍니다.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. 영역 내에 있는 이미지 부분만 EllipseGeometry 표시 됩니다.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
다음 예제에서는 프레임 워크 요소의 영역에 애니메이션 효과를 주는 방법을 보여 줍니다 Clip .The following example shows how animate a framework element's Clip region. 이 예제에서는 EllipseGeometry 요소에 대 한 타원형 클립 영역을 정의 하는 데 사용 됩니다 Image .In this example, an EllipseGeometry is used to define an elliptical clip region for an Image element. 는 PointAnimation Center (0, 0)에서 (200, 150) 까지의 타원 기 하 도형 속성에 애니메이션을 적용 합니다.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.
<Image
Source="sampleImages\Waterlilies.jpg"
Width="200" Height="150" HorizontalAlignment="Left">
<Image.Clip>
<EllipseGeometry x:Name="MyEllipseGeometry1"
RadiusX="100"
RadiusY="75"
Center="100,75"/>
</Image.Clip>
<Image.Triggers>
<EventTrigger RoutedEvent="Image.Loaded">
<BeginStoryboard>
<Storyboard>
<PointAnimation
Storyboard.TargetName="MyEllipseGeometry1"
Storyboard.TargetProperty="(EllipseGeometry.Center)"
From="0,0" To="200,150" Duration="0:0:3" RepeatBehavior="Forever"
AutoReverse="True" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
전체 샘플은 Clip Region 샘플을 참조 하세요.For the full sample, see the Clip Region Sample.
설명
기 하 도형 외부의 요소는 렌더링 된 레이아웃에서 시각적으로 잘립니다.Elements outside the geometry will be visually clipped in the rendered layout. 기 하 도형은 사각형 일 필요가 없습니다.The geometry does not have to be rectangular.
종속성 속성 정보Dependency Property Information
식별자 필드Identifier field | ClipProperty |
메타 데이터 속성 설정 true Metadata properties set to true |
NoneNone |