<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSImageCell",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSImageCell"
  },
  "title" : "NSImageCell"
}
-->

# NSImageCell

An `NSImageCell` object displays a single image (encapsulated in an [`NSImage`](/documentation/AppKit/NSImage) object) in a frame. This class provides methods for choosing the frame and for aligning and scaling the image to fit the frame.

```
class NSImageCell
```

## Overview

The object value of an `NSImageCell` object must be an [`NSImage`](/documentation/AppKit/NSImage) object, so if you use the [`objectValue`](/documentation/AppKit/NSCell/objectValue) method of [`NSCell`](/documentation/AppKit/NSCell), be sure to supply an [`NSImage`](/documentation/AppKit/NSImage) object as an argument. Because an [`NSImage`](/documentation/AppKit/NSImage) object does not need to be converted for display, do not use the [`NSCell`](/documentation/AppKit/NSCell) methods relating to formatters.

An `NSImageCell` object is usually associated with some kind of control object. For example, an [`NSMatrix`](/documentation/AppKit/NSMatrix) or an [`NSTableView`](/documentation/AppKit/NSTableView).

### Designated Initializers

When subclassing `NSImageCell` you must implement all of the designated initializers. Those methods are: init, [`init(coder:)`](/documentation/AppKit/NSCell/init(coder:)), [`init(textCell:)`](/documentation/AppKit/NSCell/init(textCell:)), and [`init(imageCell:)`](/documentation/AppKit/NSCell/init(imageCell:)).

## Topics

### Aligning and Scaling the Image

[`imageAlignment`](/documentation/AppKit/NSImageCell/imageAlignment)

The alignment of the receiver’s image relative to its frame.

[`imageScaling`](/documentation/AppKit/NSImageCell/imageScaling)

The scaling mode used to fit the receiver’s image into the frame.

### Choosing the Frame

[`imageFrameStyle`](/documentation/AppKit/NSImageCell/imageFrameStyle)

The style of the frame that borders the image.

### Constants

[`NSImageAlignment`](/documentation/AppKit/NSImageAlignment)

Constants used by [`imageAlignment`](/documentation/AppKit/NSImageCell/imageAlignment) that allow you to specify the location of the image in the frame.

[`FrameStyle`](/documentation/AppKit/NSImageView/FrameStyle)

Constants that allow you to specify the kind of frame bordering the image.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`NSAccessibilityElementProtocol`](/documentation/AppKit/NSAccessibilityElementProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSAccessibilityProtocol`](/documentation/AppKit/NSAccessibilityProtocol)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

### Inherits From

[`NSCell`](/documentation/AppKit/NSCell)

---

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)