Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/AppKit.framework |
Availability | Available in Mac OS X v10.0 and later. |
Companion guide | |
Declared in | NSImageView.h |
Related sample code |
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.
Returns a Boolean value indicating whether the receiver allows the user to cut, copy and paste of the image contents.
- (BOOL)allowsCutCopyPaste
YES
if the user can cut, copy, and paste the image contents; otherwise, NO
.
NSImageView.h
Returns a Boolean value indicating whether the receiver automatically plays animated images.
- (BOOL)animates
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.
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.
NSImageView.h
Returns the NSImage
object displayed by the receiver.
- (NSImage *)image
The NSImage
object.
NSImageView.h
Returns the position of the cell’s image in the frame.
- (NSImageAlignment)imageAlignment
The image alignment. For a list of possible alignments, see setImageAlignment:
. The default value is NSImageAlignCenter
.
NSImageView.h
Returns the style of frame that appears around the image.
- (NSImageFrameStyle)imageFrameStyle
The current image style. For a list of frame styles, see setImageFrameStyle:
. The default value is NSImageFrameNone
.
NSImageView.h
Returns the way the cell’s image alters to fit the frame.
- (NSImageScaling)imageScaling
The scaling option. For a list of possible values, see setImageScaling:
. The default value is NSScaleProportionally
.
NSImageView.h
Returns a Boolean value indicating whether the user can drag a new image into the frame.
- (BOOL)isEditable
YES
if the user can drag an image into the receiver's frame; otherwise, NO
. The default value is YES
.
NSImageView.h
Sets whether the receiver allows the user to cut, copy and paste the image contents.
- (void)setAllowsCutCopyPaste:(BOOL)allow
YES
if the user can cut, copy, and paste the image contents; otherwise, NO
to prevent the use of pasteboard operations.
NSImageView.h
Sets whether the receiver automatically plays an animated image that is assigned to it.
- (void)setAnimates:(BOOL)flag
YES
if the receiver should automatically plays animated images; otherwise, NO
.
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.
NSImageView.h
Sets whether the user can drag a new image into the frame.
- (void)setEditable:(BOOL)flag
YES
if the user can drag an image into the receiver's frame; otherwise, NO
.
NSImageView.h
Sets the image of the receiver.
- (void)setImage:(NSImage *)image
The image to display in the receiver.
NSImageView.h
Sets the position of the image in the frame.
- (void)setImageAlignment:(NSImageAlignment)alignment
The possible values for this parameter are:
NSImageView.h
Sets the kind of frame that borders the image.
- (void)setImageFrameStyle:(NSImageFrameStyle)frameStyle
The possible values for this parameter are as follows:
NSImageFrameNone
—an invisible frame
NSImageFramePhoto
—a thin black outline and a dropped shadow
NSImageFrameGrayBezel
—a gray, concave bezel that makes the image look sunken
NSImageFrameGroove
—a thin groove that looks etched around the image
NSImageFrameButton
—a convex bezel that makes the image stand out in relief, like a button
NSImageView.h
Sets the way the image alters to fit the frame.
- (void)setImageScaling:(NSImageScaling)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.
NSImageView.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-01-22)