- Inherits from:
- NSImageRep : NSObject
- Conforms to:
- NSCoding
- (NSImageRep)
- NSCopying (NSImageRep)
- NSObject (NSObject)
Declared in:
- AppKit/NSCustomImageRep.h
An NSCustomImageRep is an object that uses a delegated method to render an image. When called upon to produce the image, it sends a message to its delegate to have the method performed.
Like most other kinds of NSImageReps, an NSCustomImageRep is generally used indirectly, through an NSImage object. An NSImage must be able to choose between various representations of a given image. It also needs to provide an off-screen cache of the appropriate depth for any image it uses. It determines this information by querying its NSImageReps.
Thus to work with an NSImage, an NSCustomImageRep must be able to provide some information about its image. Use the following methods, inherited from the NSImageRep class, to set attributes of the NSCustomImageRep:
Note that if these attributes aren't set, and an NSCustomImageRep is used in an NSImage with other representations, NSImage won't be able to select among them. In practice, this usually isn't a problem.
- Initializing a new NSCustomImageRep
- - initWithDrawSelector:delegate:
- Identifying the object
- - delegate
- - drawSelector
- (id)delegate
- (SEL)drawSelector
- (id)initWithDrawSelector:(SEL)aMethod
delegate:(id)anObject
Returns self.
See Also: - draw (NSImageRep)