Up

# NSImageCell

### Authors

Jonathan Gapen (`jagapen@smithlab.chem.wisc.edu`)

> The image cell class

Copyright: (C) 1999, 2005-2022 Free Software Foundation, Inc.

# Software documentation for the NSImageCell class

## NSImageCell : NSCell

> Declared in:
>   AppKit/NSImageCell.h

Availability: OpenStep

An NSImageCell is a cell that can display a single image. It is normally associated with an NSImageView control; but you can use it as a building block in your own controls.

The image to display is set using the -setImage: method which is inherited from the superclass.

The -setImageAlignment: and -setImageScaling: methods can be used to control how the image is drawn inside a rectangle which is larger or smaller than the image size; the image might need to be scaled, cropped or aligned.

The -setImageFrameStyle: method can be used to control if the cell should display a frame border, and which one.

Instance Variables
Method summary

- -imageAlignment
- -imageFrameStyle
- -imageScaling
- -setImageAlignment:
- -setImageFrameStyle:
- -setImageScaling:

### imageAlignment

- (NSImageAlignment) imageAlignment;
Availability: OpenStep
Returns the alignment used when displaying the image inside a cell that is bigger than the image, and NSScaleToFit has not been selected.

### imageFrameStyle

- (NSImageFrameStyle) imageFrameStyle;
Availability: OpenStep
Returns the style used to draw the frame around the image.

### imageScaling

- (NSImageScaling) imageScaling;
Availability: OpenStep
Returns the type of image scaling used on the image when the image natural size and the cell size are different.

### setImageAlignment:

- (void) setImageAlignment: (NSImageAlignment)anAlignment;
Availability: OpenStep
Sets the alignment used when displaying the image inside a cell that is bigger than the image, and NSScaleToFit has not been selected.

### setImageFrameStyle:

- (void) setImageFrameStyle: (NSImageFrameStyle)aFrameStyle;
Availability: OpenStep
Sets the style used to draw the frame around the image.

### setImageScaling:

- (void) setImageScaling: (NSImageScaling)scaling;
Availability: OpenStep
Sets the type of image scaling used on the image when the image natural size and the cell size are different.

## Instance Variables for NSImageCell Class

### _frameStyle

@protected NSImageFrameStyle _frameStyle;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _imageAlignment

@protected NSImageAlignment _imageAlignment;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _imageScaling

@protected NSImageScaling _imageScaling;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _original_image_size

@protected NSSize _original_image_size;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

Up