<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/bitmapImageRepForCachingDisplay(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(im)bitmapImageRepForCachingDisplayInRect:"
  },
  "title" : "bitmapImageRepForCachingDisplay(in:)"
}
-->

# bitmapImageRepForCachingDisplay(in:)

Returns a bitmap-representation object suitable for caching the specified portion of the view.

```
func bitmapImageRepForCachingDisplay(in rect: NSRect) -> NSBitmapImageRep?
```

## Parameters

`rect`

A rectangle defining the area of the view to be cached.

## Return Value

An autoreleased [`NSBitmapImageRep`](/documentation/AppKit/NSBitmapImageRep) object or `nil` if the object could not be created.

## Discussion

Passing the visible rectangle of the view (`[self visibleRect]`) returns a bitmap suitable for caching the current contents of the view, including all of its descendants.

---

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)