CPObjectCPImage
@implementation CPImage : CPObject
CPImage
is used to represent images in the Cappuccino framework. It supports loading
all image types supported by the browser.
Method Summary | |
---|---|
-(CPImage) | initByReferencingFile:(CPString)aFilename size:(CGSize)aSize Initializes the image, by associating it with a filename. |
-(id) | initWithCoder:(CPCoder)aCoder Initializes the image with data from a coder. |
-(CPImage) | initWithContentsOfFile:(CPString)aFilename Initializes the receiver with the contents of the specified image file. |
-(CPImage) | initWithContentsOfFile:(CPString)aFilename size:(CGSize)aSize Initializes the image. |
-(id) | delegate Returns the receiver's delegate. |
-(void) | encodeWithCoder:(CPCoder)aCoder Writes the image data from memory into the coder. |
-(CPString) | filename Returns the path of the file associated with this image. |
-(BOOL) | isNinePartImage |
-(BOOL) | isThreePartImage |
-(void) | load Loads the image data from the file into memory. |
-(BOOL) | loadStatus Returns YES if the image data has already been loaded. |
-(void) | setDelegate:(id)aDelegate Sets the receiver's delegate. |
-(void) | setSize:(CGSize)aSize Sets the size of the image. |
-(CGSize) | size Returns the size of the image. |
Delegate Method Summary | |
---|---|
-(void) | imageDidLoad:(CPImage)image Called when the specified image has finished loading. |
-(void) | imageDidError:(CPImage)image Called when the specified image had an error loading. |
-(void) | imageDidAbort:(CPImage)image Called when the image loading was aborted. |
Method Detail |
---|
-(CPImage)initByReferencingFile:(CPString)aFilename size:(CGSize)aSize
aFilename
is not actually loaded. It will
be loaded once needed.aFilename
- the file containing the imageaSize
- the image's size-(id)initWithCoder:(CPCoder)aCoder
aCoder
- the coder from which to read the image data-(CPImage)initWithContentsOfFile:(CPString)aFilename
aFilename
- the file name of the image-(CPImage)initWithContentsOfFile:(CPString)aFilename size:(CGSize)aSize
aFilename
- the image to loadaSize
- the size of the image-(id)delegate
-(void)encodeWithCoder:(CPCoder)aCoder
aCoder
- the coder to which the data will be written-(CPString)filename
-(BOOL)isNinePartImage
-(BOOL)isThreePartImage
-(void)load
-(BOOL)loadStatus
YES
if the image data has already been loaded.-(void)setDelegate:(id)aDelegate
aDelegate
-(void)setSize:(CGSize)aSize
aSize
-(CGSize)size
Delegate Method Detail |
---|
-(void)imageDidLoad:(CPImage)image
image
- the image that loaded-(void)imageDidError:(CPImage)image
image
- the image with the loading error-(void)imageDidAbort:(CPImage)image
image
- the image that was abortedCreated on Sat Sep 13 14:15:43 PDT 2008