# VisualElementCaptureExtensions

> Use these extension methods to capture the rendered visual content of a VisualElement into a RenderTexture.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine.UIElements](/engine/6000.7/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
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](/engine/6000.7/script-reference/unityengine/uielements/imguicontainer.md) 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](/engine/6000.7/script-reference/unityengine/uielements/imguicontainer.md)'s content is blank in the result.

## Static Methods

| Method                                                                                                                                              | Description                                                                                                                                                                                            |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [CaptureIntoRenderTexture](/engine/6000.7/script-reference/unityengine/uielements/visualelementcaptureextensions/captureintorendertexture.md)       | Renders the element's panel and captures the visual content of `element` into the supplied `destination`.                                                                                              |
| [CaptureToRenderTexture](/engine/6000.7/script-reference/unityengine/uielements/visualelementcaptureextensions/capturetorendertexture.md)           | Renders the element's panel and captures the visual content of `element` into a new [RenderTexture](/engine/6000.7/script-reference/unityengine/rendertexture.md) sized to the element's pixel bounds. |
| [TryCaptureIntoRenderTexture](/engine/6000.7/script-reference/unityengine/uielements/visualelementcaptureextensions/trycaptureintorendertexture.md) | Renders the element's panel and captures the visual content of `element` into the supplied `destination`. Returns `false` when the element cannot be captured.                                         |
