Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


VisualElementCaptureExtensions

Use these extension methods to capture the rendered visual content of a VisualElement into a RenderTexture.
Read time 1 minuteLast updated 5 days ago

Definition

public static class VisualElementCaptureExtensions

Remarks

You can capture elements that are part of an editor panel or a runtime panel, except if the element draws directly into a camera (for example, a world space runtime panel). These methods render the whole panel, so any elements drawn on top of the captured element are reflected in the result.
The content of an IMGUIContainer is captured only when you call the capture method from within IMGUI event processing in the Editor, for example from an OnGUI callback. In any other context, the IMGUIContainer's content is blank in the result.

Static Methods

Method

Description

CaptureIntoRenderTextureRenders the element's panel and captures the visual content of
element
into the supplied
destination
.
CaptureToRenderTextureRenders the element's panel and captures the visual content of
element
into a new RenderTexture sized to the element's pixel bounds.
TryCaptureIntoRenderTextureRenders the element's panel and captures the visual content of
element
into the supplied
destination
. Returns
false
when the element cannot be captured.