Inherits From:
NSImageRep : NSObject
Conforms To:
NSCoding (from NSImageRep)
NSCopying (from NSImageRep)
NSObject (from NSObject)
Declared In:
AppKit/NSCustomImageRep.h
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:
setSize:
setColorSpaceName:
setAlpha:
setPixelsHigh:
setPixelsWide:
setBitsPerSample:
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 between them. In actual practice, this usually isn't a problem.
delegate
Returns the delegate object that renders the image for the NSCustomImageRep.
drawSelector
Returns the associated draw method selector.
initWithDrawSelector:
(SEL)aMethod delegate:
(id)anObject
Initializes the receiver, a newly allocated NSCustomImageRep instance, so that it delegates responsibility for rendering the image to anObject. When the NSCustomImageRep receives a draw
message, it will in turn send a message to anObject to perform the aMethod method. The aMethod method should take only one argument, the id
of the NSCustomImageRep. It should draw the image at location (0.0, 0.0) in the current coordinate system.
Returns self
.
See also:
- draw
(NSImageRep)