Mac Developer Library

Developer

Quartz Framework Reference IKImageView Class Reference

Options
Deployment Target:

On This Page
Language:

IKImageView

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. It supports drag and drop for the NSFilenamesPboardType flavor so that the user can drag an image to the view. If possible, image rendering uses hardware acceleration to achieve optimal performance. The IKImageView class is implemented as a subclass of NSView. Similar to NSImageView, the IKImageView class is used to display a single image. More...

Inheritance


Import Statement


import Quartz @import Quartz;

Availability


Available in OS X v10.5 and later.
  • delegate delegate Property

    Specifies the delegate object of the receiver.

    Declaration

    Swift

    unowned(unsafe) var delegate: AnyObject!

    Objective-C

    @property(assign) id delegate

    Discussion

    An IKImageView object’s delegate is inserted in the responder chain after the image view itself and is informed of various actions by the image view through delegation messages.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Specifies the zoom factor for the image view.

    Declaration

    Swift

    var zoomFactor: CGFloat

    Objective-C

    @property CGFloat zoomFactor

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Specifies the rotation angle for the image view.

    Declaration

    Swift

    var rotationAngle: CGFloat

    Objective-C

    @property CGFloat rotationAngle

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Specifies the current tool mode for the image view.

    Declaration

    Swift

    var currentToolMode: String!

    Objective-C

    @property(copy) NSString *currentToolMode

    Discussion

    See Tool Modes for possible values.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Specifies the automatic resizing state for the image view.

    Declaration

    Swift

    var autoresizes: Bool

    Objective-C

    @property BOOL autoresizes

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Specifies the horizontal scroll bar state for the image view.

    Declaration

    Swift

    var hasHorizontalScroller: Bool

    Objective-C

    @property BOOL hasHorizontalScroller

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Specifies the vertical scroll bar state for the image view.

    Declaration

    Swift

    var hasVerticalScroller: Bool

    Objective-C

    @property BOOL hasVerticalScroller

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    var autohidesScrollers: Bool

    Objective-C

    @property BOOL autohidesScrollers

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    var supportsDragAndDrop: Bool

    Objective-C

    @property BOOL supportsDragAndDrop

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • editable editable Property

    Specifies the editable state for the image view.

    Declaration

    Swift

    var editable: Bool

    Objective-C

    @property BOOL editable

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    var doubleClickOpensImageEditPanel: Bool

    Objective-C

    @property BOOL doubleClickOpensImageEditPanel

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Specifies a Core Image filter for image correction.

    Declaration

    Swift

    unowned(unsafe) var imageCorrection: CIFilter!

    Objective-C

    @property(assign) CIFilter *imageCorrection

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Specifies the background color for the image view.

    Declaration

    Swift

    unowned(unsafe) var backgroundColor: NSColor!

    Objective-C

    @property(assign) NSColor *backgroundColor

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Returns the size of the image in the image view.

    Declaration

    Swift

    func imageSize() -> NSSize

    Objective-C

    - (NSSize)imageSize

    Return Value

    The size of the image.

    Discussion

    The image size changes whenever an image is rotates or cropped.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Returns the metadata for the image in the view.

    Declaration

    Swift

    func imageProperties() -> [NSObject : AnyObject]!

    Objective-C

    - (NSDictionary *)imageProperties

    Return Value

    A dictionary of metadata that specifies the image properties.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func image() -> Unmanaged<CGImage>!

    Objective-C

    - (CGImageRef)image

    Return Value

    The image.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Sets the image to display in an image view.

    Declaration

    Swift

    func setImage(_ image: CGImage!, imageProperties metaData: [NSObject : AnyObject]!)

    Objective-C

    - (void)setImage:(CGImageRef)image imageProperties:(NSDictionary *)metaData

    Parameters

    image

    The image to set.

    metaData

    A dictionary that contains metadata that describes the image.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func setImageWithURL(_ url: NSURL!)

    Objective-C

    - (void)setImageWithURL:(NSURL *)url

    Parameters

    url

    The URL that specifies the location of the image.

    Discussion

    This method is the preferred initializer for RAW images. If you use this method for a TIFF file that contains multiple images, only the first image is displayed.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Sets the rotation angle at the provided origin.

    Declaration

    Swift

    func setRotationAngle(_ rotationAngle: CGFloat, centerPoint centerPoint: NSPoint)

    Objective-C

    - (void)setRotationAngle:(CGFloat)rotationAngle centerPoint:(NSPoint)centerPoint

    Parameters

    rotationAngle

    The rotation angle to apply to the image.

    centerPoint

    The point that specifies the origin of the rotation angle.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

    See Also

    rotationAngle

  • Sets the zoom factor at the provided origin.

    Declaration

    Swift

    func setImageZoomFactor(_ zoomFactor: CGFloat, centerPoint centerPoint: NSPoint)

    Objective-C

    - (void)setImageZoomFactor:(CGFloat)zoomFactor centerPoint:(NSPoint)centerPoint

    Parameters

    zoomFactor

    The zoom factor to apply to the image.

    centerPoint

    The point that specifies the origin of the zoom factor.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

    See Also

    zoomFactor

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

    Declaration

    Swift

    @IBAction func zoomImageToFit(_ sender: AnyObject!)

    Objective-C

    - (IBAction)zoomImageToFit:(id)sender

    Parameters

    sender

    The object initiating the action.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    @IBAction func zoomImageToActualSize(_ sender: AnyObject!)

    Objective-C

    - (IBAction)zoomImageToActualSize:(id)sender

    Parameters

    sender

    The object initiating the action.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func zoomImageToRect(_ rect: NSRect)

    Objective-C

    - (void)zoomImageToRect:(NSRect)rect

    Parameters

    rect

    The rectangle to fit the image in.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Zooms the image in.

    Declaration

    Swift

    @IBAction func zoomIn(_ sender: AnyObject!)

    Objective-C

    - (IBAction)zoomIn:(id)sender

    Parameters

    sender

    Typically the object that invoked this method.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.6 and later.

  • Zooms the image out.

    Declaration

    Swift

    @IBAction func zoomOut(_ sender: AnyObject!)

    Objective-C

    - (IBAction)zoomOut:(id)sender

    Parameters

    sender

    Typically the object that invoked this method.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.6 and later.

  • Crops the image using the current selection.

    Declaration

    Swift

    @IBAction func crop(_ sender: AnyObject!)

    Objective-C

    - (IBAction)crop:(id)sender

    Parameters

    sender

    Typically the object that invoked this method.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.6 and later.

  • Flips an image along the horizontal axis.

    Declaration

    Swift

    @IBAction func flipImageHorizontal(_ sender: AnyObject!)

    Objective-C

    - (IBAction)flipImageHorizontal:(id)sender

    Parameters

    sender

    The object initiating the action.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Flips an image along the vertical axis.

    Declaration

    Swift

    @IBAction func flipImageVertical(_ sender: AnyObject!)

    Objective-C

    - (IBAction)flipImageVertical:(id)sender

    Parameters

    sender

    The object initiating the action.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Rotates the image left (counter-clockwise).

    Declaration

    Swift

    @IBAction func rotateImageLeft(_ sender: AnyObject!)

    Objective-C

    - (IBAction)rotateImageLeft:(id)sender

    Parameters

    sender

    Typically the object that invoked this method.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.6 and later.

  • Rotates the image right (clockwise).

    Declaration

    Swift

    @IBAction func rotateImageRight(_ sender: AnyObject!)

    Objective-C

    - (IBAction)rotateImageRight:(id)sender

    Parameters

    sender

    Typically the object that invoked this method.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.6 and later.

  • Scrolls the view to the specified point.

    Declaration

    Swift

    func scrollToPoint(_ point: NSPoint)

    Objective-C

    - (void)scrollToPoint:(NSPoint)point

    Parameters

    point

    The point to scroll to.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func scrollToRect(_ rect: NSRect)

    Objective-C

    - (void)scrollToRect:(NSRect)rect

    Parameters

    rect

    The rectangular area to include in the view.

    Import Statement

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Image Kit tools modes referenced by the currentToolMode property.

    Declaration

    Swift

    let IKToolModeNone: NSString! let IKToolModeMove: NSString! let IKToolModeSelect: NSString! let IKToolModeSelectRect: NSString! let IKToolModeSelectEllipse: NSString! let IKToolModeSelectLasso: NSString! let IKToolModeCrop: NSString! let IKToolModeRotate: NSString! let IKToolModeAnnotate: NSString!

    Objective-C

    NSString *const IKToolModeNone; NSString *const IKToolModeMove; NSString *const IKToolModeSelect; NSString *const IKToolModeSelectRect; NSString *const IKToolModeSelectEllipse; NSString *const IKToolModeSelectLasso; NSString *const IKToolModeCrop; NSString *const IKToolModeRotate; NSString *const IKToolModeAnnotate;

    Constants

    • IKToolModeNone

      IKToolModeNone

      No tool is set.

      Available in OS X v10.5 and later.

    • IKToolModeMove

      IKToolModeMove

      The move tool.

      Available in OS X v10.5 and later.

    • IKToolModeSelect

      IKToolModeSelect

      The selection tool.

      Available in OS X v10.5 and later.

    • IKToolModeSelectRect

      IKToolModeSelectRect

      Same as IKToolModeSelect.

      Available in OS X v10.6 and later.

    • IKToolModeSelectEllipse

      IKToolModeSelectEllipse

      The selection ellipse.

      Available in OS X v10.6 and later.

    • IKToolModeSelectLasso

      IKToolModeSelectLasso

      The selection lasso.

      Available in OS X v10.6 and later.

    • IKToolModeCrop

      IKToolModeCrop

      The crop tool.

      Available in OS X v10.5 and later.

    • IKToolModeRotate

      IKToolModeRotate

      The rotation tool.

      Available in OS X v10.5 and later.

    • IKToolModeAnnotate

      IKToolModeAnnotate

      The annotation tool.

      Available in OS X v10.5 and later.

    Import Statement

  • A layer level.

    Declaration

    Swift

    let IKOverlayTypeBackground: NSString! let IKOverlayTypeImage: NSString!

    Objective-C

    NSString *const IKOverlayTypeBackground; NSString *const IKOverlayTypeImage;

    Constants

    • IKOverlayTypeBackground

      IKOverlayTypeBackground

      A background.

      Available in OS X v10.5 and later.

    • IKOverlayTypeImage

      IKOverlayTypeImage

      An image.

      Available in OS X v10.5 and later.

    Import Statement