<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSBitmapImageRep/init(focusedViewRect:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBitmapImageRep(im)initWithFocusedViewRect:"
  },
  "title" : "init(focusedViewRect:)"
}
-->

# init(focusedViewRect:)

Initializes a newly allocated bitmap image representation with bitmap data from a rendered image.

```
init?(focusedViewRect rect: NSRect)
```

## Parameters

`rect`

A rectangle that specifies an area of the current window in the current coordinate system.

## Return Value

Returns the initialized object or `nil` If for any reason the new object can’t be initialized.

## Discussion

This method uses imaging operators to read the image data into a buffer; the object is then created from that data. The object is initialized with information about the image obtained from the window server.

---

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)