<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuickLookUI",
  "identifier" : "/documentation/QuickLookUI/QLPreviewPanelDelegate/previewPanel(_:transitionImageFor:contentRect:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quick Look UI"
    ],
    "preciseIdentifier" : "c:objc(pl)QLPreviewPanelDelegate(im)previewPanel:transitionImageForPreviewItem:contentRect:"
  },
  "title" : "previewPanel(_:transitionImageFor:contentRect:)"
}
-->

# previewPanel(_:transitionImageFor:contentRect:)

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

```
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

The image to use for the transition zoom effect for the `item`.

## 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 <doc://com.apple.documentation/documentation/AppKit/NSImage>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)