NSImageView Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSImageView.h |
Overview
An NSImageView object displays a single image from an NSImage object in a frame and can optionally allow a user to drag an image to it.
Tasks
Choosing the Image
Choosing the Frame
Aligning and Scaling the Image
Responding to User Events
Animating Image Playback
Pasteboard Support
Instance Methods
allowsCutCopyPaste
Returns a Boolean value indicating whether the receiver allows the user to cut, copy and paste of the image contents.
Return Value
YES if the user can cut, copy, and paste the image contents; otherwise, NO.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSImageView.hanimates
Returns a Boolean value indicating whether the receiver automatically plays animated images.
Return Value
YES if the receiver automatically plays animated images; otherwise, NO. The default value is YES for NSImageView objects you create programmatically. For NSImageView objects loaded from a nib file, the control takes the value set in Interface Builder.
Discussion
The timing and looping characteristics of the animation are taken from the image data. If this method returns NO, the receiver displays the first frame of the animation only.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSImageView.himage
Returns the NSImage object displayed by the receiver.
Return Value
The NSImage object.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSImageView.himageAlignment
Returns the position of the cell’s image in the frame.
Return Value
The image alignment. For a list of possible alignments, see setImageAlignment:. The default value is NSImageAlignCenter.
Availability
- Available in OS X v10.0 and later.
Declared In
NSImageView.himageFrameStyle
Returns the style of frame that appears around the image.
Return Value
The current image style. For a list of frame styles, see setImageFrameStyle:. The default value is NSImageFrameNone.
Availability
- Available in OS X v10.0 and later.
Declared In
NSImageView.himageScaling
Returns the way the cell’s image alters to fit the frame.
Return Value
The scaling option. For a list of possible values, see setImageScaling:. The default value is NSScaleProportionally.
Availability
- Available in OS X v10.0 and later.
Declared In
NSImageView.hisEditable
Returns a Boolean value indicating whether the user can drag a new image into the frame.
Return Value
YES if the user can drag an image into the receiver's frame; otherwise, NO. The default value is YES.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSImageView.hsetAllowsCutCopyPaste:
Sets whether the receiver allows the user to cut, copy and paste the image contents.
Parameters
- allow
YESif the user can cut, copy, and paste the image contents; otherwise,NOto prevent the use of pasteboard operations.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSImageView.hsetAnimates:
Sets whether the receiver automatically plays an animated image that is assigned to it.
Parameters
- flag
YESif the receiver should automatically plays animated images; otherwise,NO.
Discussion
The timing and looping characteristics of the animation are taken from the image data. If you specify NO, the receiver displays the first frame of the animation only.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSImageView.hsetEditable:
Sets whether the user can drag a new image into the frame.
Parameters
- flag
YESif the user can drag an image into the receiver's frame; otherwise,NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSImageView.hsetImage:
Sets the image of the receiver.
Parameters
- image
The image to display in the receiver.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSImageView.hsetImageAlignment:
Sets the position of the image in the frame.
Parameters
- alignment
The possible values for this parameter are:
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSImageView.hsetImageFrameStyle:
Sets the kind of frame that borders the image.
Parameters
- frameStyle
The possible values for this parameter are as follows:
NSImageFrameNone—an invisible frameNSImageFramePhoto—a thin black outline and a dropped shadowNSImageFrameGrayBezel—a gray, concave bezel that makes the image look sunkenNSImageFrameGroove—a thin groove that looks etched around the imageNSImageFrameButton—a convex bezel that makes the image stand out in relief, like a button
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSImageView.hsetImageScaling:
Sets the way the image alters to fit the frame.
Parameters
- scaling
The possible values for this parameter are:
NSScaleProportionally. If the image is too large, it shrinks to fit inside the frame. The proportions of the image are preserved. The image is never scaled up to fit a larger frame.NSScaleToFit. The image shrinks or expands, and its proportions distort, until it exactly fits the frame.NSScaleNone. The size and proportions of the image don’t change. If the frame is too small to display the whole image, the edges of the image are trimmed off.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSImageView.h© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-01-22)