Compartilhar via


IXRUIElement::SetClip (Compact 2013)

3/28/2014

This method sets the geometry used to define the outline of a UI element.

Syntax

virtual HRESULT STDMETHODCALLTYPE SetClip(
    IXRGeometry *pClip
) = 0; 

Parameters

  • pClip
    [in] Pointer to an IXRGeometry object that contains information about the geometry to be used for sizing the clipping area.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

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

The clipped area is the "outside" of the geometry. In other words, the content that is shown (not clipped) is the area of the geometry that would otherwise be filled with a Brush, if the geometry were used as data for an IXRPath object instead of for clipping. The clipping area is any area that falls outside the geometry overlay. For complex geometries, the areas that are clipped or not clipped are influenced by the geometry's FillRule property, obtainable through IXRGeometry::GetFillRule.

Clipping with an IXRLineGeometry by itself will result in total clipping because the line by itself has no dimension. IXREllipseGeometry, IXRGeometryGroup, or IXRRectangleGeometry are probably the simplest classes to use for pClip, however it is possible to use an IXRPathGeometry for more complex results.

If you would rather write code that shows the full UI element instead of a UI clipped element, you can use IXRUIElement::SetOpacityMask, passing in either a IXRRadialGradientBrush or IXRImageBrush that uses a transparency mask. If you use this technique, you can create "blend" effects against the background. The "clip" technique always results in hard edges where the clip is applied.

.NET Framework Equivalent

System.Windows.UIElement.Clip

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRUIElement
IXRUIElement::GetClip