# OnPreviewGUI(Rect, GUIStyle)

> Custom preview for Image component.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public override void OnPreviewGUI(Rect r, GUIStyle background)
```

### Parameters

**** (\[Rect]\(/engine/6000.0/script-reference/unityengine/rect)): Rectangle in which to draw the preview.**** (\[GUIStyle]\(/engine/6000.0/script-reference/unityengine/guistyle)): Background image.

### Remarks

Additional Resources: [ObjectPreview.OnPreviewGUI](/engine/6000.0/script-reference/unityeditor/objectpreview/onpreviewgui.md).
