# Sandbox.UI.TexturePreview

A texture preview with pointer-anchored wheel zoom and drag panning.
The caller retains ownership of the texture.

- Kind: class
- Namespace: `Sandbox.UI`
- Assembly: `Sandbox.Engine`
- Inherits: [Sandbox.UI.Panel](/api/Sandbox.UI.Panel)
- Modifiers: sealed

## Constructors

- [`TexturePreview`](/api/Sandbox.UI.TexturePreview/.ctor): Creates a preview in fit mode.

## Properties

- [`DisplayName`](/api/Sandbox.UI.TexturePreview/DisplayName): Optional caption above the image.
- [`Texture`](/api/Sandbox.UI.TexturePreview/Texture): Texture displayed by the preview. Replacing it with an image of the same size preserves zoom and pan.
- [`Zoom`](/api/Sandbox.UI.TexturePreview/Zoom): Magnification in layout units per texture pixel. Set to zero to fit and center the image.

## Methods

- [`Tick`](/api/Sandbox.UI.TexturePreview/Tick): Updates dimensions when the contents of a live texture resize.
