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

# IKImageView

A view that allows displaying and minor editing of an image.

```
class IKImageView
```

## Overview

The `IKImageView` class provides an efficient way to display images in a view while at the same time supporting a number of image editing operations such as rotating, zooming, and cropping. If possible, image rendering uses hardware acceleration to achieve optimal performance. The `IKImageView` class is implemented as a subclass of <doc://com.apple.documentation/documentation/AppKit/NSView>. Similar to <doc://com.apple.documentation/documentation/AppKit/NSImageView>, the `IKImageView` class is used to display a single image.

You can provide an images for the view in any of these formats:

- File reference (<doc://com.apple.documentation/documentation/Foundation/NSURL>, <doc://com.apple.documentation/documentation/CoreFoundation/CFURL>, or a path)
- <doc://com.apple.documentation/documentation/ImageIO/CGImageSource>
- Data (<doc://com.apple.documentation/documentation/Foundation/NSData> or <doc://com.apple.documentation/documentation/CoreFoundation/CFData>)
- Image (<doc://com.apple.documentation/documentation/CoreGraphics/CGImage> or <doc://com.apple.documentation/documentation/CoreImage/CIImage>)

Providing a file reference is the preferred way to set the the image for a view because in addition to the actual image data, `IKImageView` also handles the image metadata embedded in the file. The image view automatically fetches the metadata from a file reference, whereas for the other sources (except for a <doc://com.apple.documentation/documentation/ImageIO/CGImageSource> source), it cannot. For images set from other sources, you need to set the metadata separately.

`IKImageView` supports multi-frame images (TIFF, GIF, and so forth) and animated images.

## Topics

### Getting and Setting Image View Characteristics

[`var delegate: AnyObject!`](/documentation/Quartz/IKImageView/delegate)

Specifies the delegate object of the receiver.

[`var zoomFactor: CGFloat`](/documentation/Quartz/IKImageView/zoomFactor)

Specifies the zoom factor for the image view.

[`var rotationAngle: CGFloat`](/documentation/Quartz/IKImageView/rotationAngle)

Specifies the rotation angle for the image view.

[`var currentToolMode: String!`](/documentation/Quartz/IKImageView/currentToolMode)

Specifies the current tool mode for the image view.

[`var autoresizes: Bool`](/documentation/Quartz/IKImageView/autoresizes)

Specifies the automatic resizing state for the image view.

[`var hasHorizontalScroller: Bool`](/documentation/Quartz/IKImageView/hasHorizontalScroller)

Specifies the horizontal scroll bar state for the image view.

[`var hasVerticalScroller: Bool`](/documentation/Quartz/IKImageView/hasVerticalScroller)

Specifies the vertical scroll bar state for the image view.

[`var autohidesScrollers: Bool`](/documentation/Quartz/IKImageView/autohidesScrollers)

Specifies the automatic-hiding scroll bar state for the image view.

[`var supportsDragAndDrop: Bool`](/documentation/Quartz/IKImageView/supportsDragAndDrop)

Specifies the drag-and-drop support state for the image view.

[`var editable: Bool`](/documentation/Quartz/IKImageView/editable)

Specifies the editable state for the image view.

[`var doubleClickOpensImageEditPanel: Bool`](/documentation/Quartz/IKImageView/doubleClickOpensImageEditPanel)

Specifies the image-opening state of the editing pane in the image view.

[`var imageCorrection: CIFilter!`](/documentation/Quartz/IKImageView/imageCorrection)

Specifies a Core Image filter for image correction.

[`var backgroundColor: NSColor!`](/documentation/Quartz/IKImageView/backgroundColor)

Specifies the background color for the image view.

[`func imageSize() -> NSSize`](/documentation/Quartz/IKImageView/imageSize())

Returns the size of the image in the image view.

[`func imageProperties() -> [AnyHashable : Any]!`](/documentation/Quartz/IKImageView/imageProperties())

Returns the metadata for the image in the view.

### Getting and Setting Images

[`func image() -> Unmanaged<CGImage>!`](/documentation/Quartz/IKImageView/image())

Returns the image associated with the view, after any image corrections.

[`func setImage(CGImage!, imageProperties: [AnyHashable : Any]!)`](/documentation/Quartz/IKImageView/setImage(_:imageProperties:))

Sets the image to display in an image view.

[`func setImageWith(URL!)`](/documentation/Quartz/IKImageView/setImageWith(_:))

Initializes an image view with the image specified by a URL.

### Manipulating the Image in a View

[`func setRotationAngle(CGFloat, center: NSPoint)`](/documentation/Quartz/IKImageView/setRotationAngle(_:center:))

Sets the rotation angle at the provided origin.

[`func setImageZoomFactor(CGFloat, center: NSPoint)`](/documentation/Quartz/IKImageView/setImageZoomFactor(_:center:))

Sets the zoom factor at the provided origin.

[`func zoomImageToFit(Any!)`](/documentation/Quartz/IKImageView/zoomImageToFit(_:))

Zooms the image so that it fits in the image view.

[`func zoomImageToActualSize(Any!)`](/documentation/Quartz/IKImageView/zoomImageToActualSize(_:))

Zooms the image so that it is displayed using its true size.

[`func zoomImage(to: NSRect)`](/documentation/Quartz/IKImageView/zoomImage(to:))

Zooms the image so that it fits in the specified rectangle.

[`func zoomIn(Any!)`](/documentation/Quartz/IKImageView/zoomIn(_:))

Zooms the image in.

[`func zoomOut(Any!)`](/documentation/Quartz/IKImageView/zoomOut(_:))

Zooms the image out.

[`func crop(Any!)`](/documentation/Quartz/IKImageView/crop(_:))

Crops the image using the current selection.

[`func flipImageHorizontal(Any!)`](/documentation/Quartz/IKImageView/flipImageHorizontal(_:))

Flips an image along the horizontal axis.

[`func flipImageVertical(Any!)`](/documentation/Quartz/IKImageView/flipImageVertical(_:))

Flips an image along the vertical axis.

[`func rotateImageLeft(Any!)`](/documentation/Quartz/IKImageView/rotateImageLeft(_:))

Rotates the image left (counter-clockwise).

[`func rotateImageRight(Any!)`](/documentation/Quartz/IKImageView/rotateImageRight(_:))

Rotates the image right (clockwise).

### Working With Core Animation

[`func setOverlay(CALayer!, forType: String!)`](/documentation/Quartz/IKImageView/setOverlay(_:forType:))

Sets an overlay type for a Core Animation layer.

[`func overlay(forType: String!) -> CALayer!`](/documentation/Quartz/IKImageView/overlay(forType:))

Returns the Core Animation layer associated with a layer type.

### Scrolling

[`func scroll(to: NSPoint)`](/documentation/Quartz/IKImageView/scroll(to:)-myqk)

Scrolls the view to the specified point.

[`func scroll(to: NSRect)`](/documentation/Quartz/IKImageView/scroll(to:)-535q6)

Scrolls the view so that it includes the provided rectangular area.

### Converting Points and Rectangles

[`func convertPoint(toImagePoint: NSPoint) -> NSPoint`](/documentation/Quartz/IKImageView/convertPoint(toImagePoint:))

Converts an image view coordinate to an image coordinate.

[`func convertRect(toImageRect: NSRect) -> NSRect`](/documentation/Quartz/IKImageView/convertRect(toImageRect:))

Converts an image view rectangle to an image rectangle.

[`func convertImagePoint(toViewPoint: NSPoint) -> NSPoint`](/documentation/Quartz/IKImageView/convertImagePoint(toViewPoint:))

Converts an image coordinate to an image view coordinate.

[`func convertImageRect(toViewRect: NSRect) -> NSRect`](/documentation/Quartz/IKImageView/convertImageRect(toViewRect:))

Converts an image rectangle to an image view rectangle.

### Constants

[Tool Modes](/documentation/Quartz/tool-modes)

Image Kit tools modes referenced by the [`currentToolMode`](/documentation/Quartz/IKImageView/currentToolMode) property.

[Overlay Types](/documentation/Quartz/overlay-types)

A layer level.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### Inherits From

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

---

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)