Use these extension methods to capture the rendered visual content of a VisualElement into a RenderTexture.
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.
| Method | Description |
|---|---|
| CaptureIntoRenderTexture | Renders the element's panel and captures the visual content of element into the supplied destination. |
| CaptureToRenderTexture | Renders the element's panel and captures the visual content of element into a new RenderTexture sized to the element's pixel bounds. |
| TryCaptureIntoRenderTexture | Renders the element's panel and captures the visual content of element into the supplied destination. Returns false when the element cannot be captured. |