O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSImage — Mac OS X 10.0

Synopsis

This class is the general interface to images in the AppKit. Instances of NSImage usually have one or more image representations (instances of the class NSImageRep or one of its subclasses) associated with them. The purpose of keeping multiple image representations is so the image data can be rendered on a variety of devices, with each image representation providing rendering functionality for a specific device.

image with no caption

@interface NSImage : NSObject <NSCoding, NSCopying>
                                  // Convenience Constructors
   + (NSArray *)imageFileTypes;
   + (id)imageNamed:(NSString *)name;
   + (NSArray *)imagePasteboardTypes;
   + (NSArray *)imageUnfilteredFileTypes;
   + (NSArray *)imageUnfilteredPasteboardTypes;
                                  // Initializers
   - (id)initByReferencingFile:(NSString *)fileName;
   - (id)initByReferencingURL:(NSURL *)url;
   - (id)initWithContentsOfFile:(NSString *)fileName;
   - (id)initWithContentsOfURL:(NSURL *)url;
   - (id)initWithData:(NSData *)data;
   - (id)initWithPasteboard:(NSPasteboard *)pasteboard;
   - (id)initWithSize:(NSSize)aSize;
                                  // Accessor Methods
   - (void)setSize:(NSSize)aSize;
   - (NSSize)size;
   - (void)setPrefersColorMatch:(BOOL)flag;
   - (BOOL)prefersColorMatch;
   - (void)setCacheMode:(NSImageCacheMode)mode;
   - (NSImageCacheMode)cacheMode;
   - (void)setUsesEPSOnResolutionMismatch:(BOOL)flag;
   - (BOOL)usesEPSOnResolutionMismatch;
   - (void)setFlipped ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required