Sdílet prostřednictvím


RenderNode.SetClipRect(Rect) Method

Definition

Sets an additional clip on the RenderNode.

[Android.Runtime.Register("setClipRect", "(Landroid/graphics/Rect;)Z", "", ApiSince=29)]
public bool SetClipRect (Android.Graphics.Rect? rect);
[<Android.Runtime.Register("setClipRect", "(Landroid/graphics/Rect;)Z", "", ApiSince=29)>]
member this.SetClipRect : Android.Graphics.Rect -> bool

Parameters

rect
Rect

the bounds to clip to. If null, the additional clip is removed.

Returns

True if the value changed, false if the new value was the same as the previous value.

Attributes

Remarks

Sets an additional clip on the RenderNode. If null, the extra clip is removed from the RenderNode. If non-null, the RenderNode will be clipped to this rect. In addition if #setClipToBounds(boolean) is true, then the RenderNode will be clipped to the intersection of this rectangle and the bounds of the render node, which is set with #setPosition(Rect).

This is equivalent to do a Canvas#clipRect(Rect) at the start of this RenderNode's display list. However, as this is a property of the RenderNode instead of part of the display list it can be more easily animated for transient additional clipping. An example usage of this would be the android.transition.ChangeBounds transition animation with the resizeClip=true option.

Java documentation for android.graphics.RenderNode.setClipRect(android.graphics.Rect).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to