Return to the Alphabetic Index
Return to the Class Browser
Return to the Picture Browser
Copyright (c) 1994 by NeXT Computer, Inc. All Rights Reserved.


Inherits From: NSObject

Conforms To: NSCoding, NSCopying NSObject (NSObject)

Declared In: AppKit/NSImageRep.h

Class Description

NSImageRep is an abstract superclass; each of its subclasses knows how to draw an image from a particular kind of source data. While an NSImageRep subclass can be used directly, it's typically used through an NSImage object. An NSImage manages a group of representations, choosing the best one for the current output device.

There are four subclasses defined in the Application Kit:

Subclass Source Data

NSBitmapImageRep Tag Image File Format (TIFF) and other bitmap data

NSEPSImageRep Encapsulated PostScript code (EPS)

NSCustomImageRep A delegated method that can draw the image

NSCachedImageRep A rendered image, usually in an off-screen window

You can define other NSImageRep subclasses for objects that render images from other types of source information. New subclasses must be added to the NSImageRep class registry by invoking the registerImageRepClass: class method. The NSImageRep subclass informs the registry of the data types it can support through its imageUnfilteredFileTypes, imageUnfilteredPasteboardTypes, and canInitWithData: class methods. Once an NSImageRep subclass is registered, an instance of that subclass is created anytime NSImage encounters the type of data handled by that subclass.

Creating an NSImageRep

Checking Data Types

Setting the Size of the Image

Specifying Information about the Representation

Drawing the Image

Managing NSImageRep Subclasses