Compartilhar via


IXRUIElement::GetClip (Compact 2013)

3/28/2014

This method retrieves the geometry that defines the outline of the contents of a UI element.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetClip(
    IXRGeometry **ppClip
) = 0;

Parameters

  • ppClip
    [out] Pointer to an IXRGeometry object that contains information about the geometry to be used for sizing a 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.

To use a specific interface pointer type, you can use the helper template version of this method that XAML for Windows Embedded provides. When you supply a derived type, this version automatically supplies a type-safe method that implicitly converts the returned type from a generic interface so you do not have to explicitly call QueryInterface to convert the generic interface into the required object type.

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 an 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::SetClip