[Previous] [Class List] [Next]

NSCachedImageRep


Inherits from: NSImageRep : NSObject
Conforms to: NSCoding
(from NSImageRep)
NSCopying (from NSImageRep)
NSObject (from NSObject)
Declared in: AppKit/NSImageRep.h




Class Description


NSCachedImageRep defines an object that stores its source data as a rendered image in a window, typically a window that stays off-screen. The only data available for reproducing the image is the image itself. Thus an NSCachedImageRep differs from the other kinds of NSImageReps defined in the Application Kit, all of which can reproduce an image from the information originally used to draw it. Instances of this class are generally used indirectly, through an NSImage object.

See "Caching Representations" in the NSImage class description for more information.


Method Types


Initializing an NSCachedImageRep
- initWithSize:depth:separate:alpha:
- initWithWindow:rect:
Getting the representation
- rect
- window

Constructors




Instance Methods



initWithSize:depth:separate:alpha:

- (id)initWithSize:(NSSize)size depth:(NSWindowDepth)depth separate:(BOOL)flag alpha:(BOOL)alpha

Initializes a new NSCachedImageRep for an image of the specified size and depth. flag indicates whether the image will get its own unique cache, instead of possibly sharing one with other images. For best performance (although it's not essential), alpha should be set according to whether the image will have a channel for transparency information.

See Also: - setAlpha: (NSImageRep), - setBitsPerSample: (NSImageRep), - setCacheDepthMatchesImageDepth: (NSImage) - setCachedSeparately: (NSImage)



initWithWindow:rect:

- (id)initWithWindow:(NSWindow *)aWindow rect:(NSRect)aRect

Initializes the receiver, a new NSCachedImageRep instance, for an image that will be rendered within the aRect rectangle in the window aWindow, and returns the initialized object. The rectangle is specified in aWindow's base coordinate system. The size of the image is set from the size of the rectangle. The window is retained.

You must draw the image in the rectangle yourself; there are no NSCachedImageRep methods for this purpose.

See Also: - size (NSImageRep)



rect

- (NSRect)rect

Returns the rectangle where the image is cached.

See Also: - size (NSImageRep)



window

- (NSWindow *)window

Returns the window where the image is cached.


[Previous] [Next]