---
title: "previewPanel(_:transitionImageFor:contentRect:)"
framework: quicklookui
role: symbol
role_heading: Instance Method
path: "quicklookui/qlpreviewpaneldelegate/previewpanel(_:transitionimagefor:contentrect:)"
---

# previewPanel(_:transitionImageFor:contentRect:)

Returns the image to use for the transition zoom effect for a given item.

## Declaration

```swift
optional func previewPanel(_ panel: QLPreviewPanel!, transitionImageFor item: (any QLPreviewItem)!, contentRect: UnsafeMutablePointer<NSRect>!) -> Any!
```

## Parameters

- `panel`: The preview panel.
- `item`: The item the system is previewing.
- `contentRect`: The rectangle within a preview image that actually represents the content of the document. For icons, the actual rectangle is typically smaller than the icon itself.

## Return Value

Return Value The image to use for the transition zoom effect for the item.

## Discussion

Discussion The system invokes this optional method when the preview panel opens or closes to provide a smooth transition when zooming. The return type of the function should be an instance of NSImage.

## See Also

### Optional Methods

- [previewPanel(_:handle:)](quicklookui/qlpreviewpaneldelegate/previewpanel(_:handle:).md)
- [previewPanel(_:sourceFrameOnScreenFor:)](quicklookui/qlpreviewpaneldelegate/previewpanel(_:sourceframeonscreenfor:).md)
