- Inherits from:
- NSCell : NSObject
- Package:
- com.apple.yellow.application
An NSImageCell displays a single NSImage in a frame. This class provides methods for choosing the frame, and for aligning and scaling the image to fit the frame.
The object value of an NSImageCell must be an NSImage, so if you use NSCell's setObjectValue method, be sure to supply an NSImage as an argument. Because an NSImage doesn't need to be converted for display, you won't use the NSCell methods relating to formatters.
An NSImageCell is usually associated with some kind of NSControl-an NSImageView, an NSMatrix, or an NSTableView. For more information, see the specifications for those classes.
- Constructors
- NSImageCell
- Aligning and scaling the image
- imageAlignment
- setImageAlignment
- imageScaling
- setImageScaling
- Choosing the frame
- imageFrameStyle
- setImageFrameStyle
public NSImageCell()
public NSImageCell(String aString)
public NSImageCell(NSImage anImage)
public int imageAlignment()
public int imageFrameStyle()
public int imageScaling()
public void setImageAlignment(int alignment)
ImageAlignLeft
ImageAlignRight
ImageAlignCenter
ImageAlignTop
ImageAlignBottom
ImageAlignTopLeft
ImageAlignTopRight
ImageAlignBottomLeft
ImageAlignBottomRight
The
default alignment is ImageAlignCenter
.
See Also: imageAlignment
public void setImageFrameStyle(int frameStyle)
ImageFrameNone
-an
invisible frameImageFramePhoto
-a thin black
outline and a dropped shadowImageFrameGrayBezel
-a gray,
concave bezel that makes the image look sunkenFrameImageGroove
-a thin groove
that looks etched around the imageImageFrameButton
-a convex
bezel that makes the image stand out in relief, like a buttonThe
default frameStyle is ImageFrameNone
.
See Also: imageFrameStyle
public void setImageScaling(int scaling)
ScaleProportionally
.
If the image is too large, it shrinks to fit inside the frame. If
the image is too small, it expands. The proportions of the image
are preserved.ScaleToFit
. The image shrinks
or expands, and its proportions distort, until it exactly fits the frame.ScaleNone
. 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.The
default scaling is ScaleProportionally
.
See Also: imageScaling