- Inherits from:
- NSImageRep : NSObject
- Conforms to:
- NSCoding
- (NSImageRep)
- NSCopying (NSImageRep)
- NSObject (NSObject)
Declared in:
- AppKit/NSEPSImageRep.h
An NSEPSImageRep is an object that can render an image from encapsulated PostScript code (EPS).
Like most other kinds of NSImageReps, an NSEPSImageRep 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 NSEPSImageRep must be able to provide some information about its image. The size of the object is set from the bounding box specified in the EPS header comments. Use these methods, inherited from the NSImageRep class, to set the other attributes of the NSEPSImageRep:
Note that if these attributes aren't set, and an NSEPSImageRep 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.
- Creating an NSEPSImageRep
- + imageRepWithData:
- - initWithData:
- Getting image data
- - boundingBox
- - EPSRepresentation
- Drawing the image
- - prepareGState
+ (id)imageRepWithData:(NSData
*)epsData
nil
.
Otherwise, it returns a new instance of NSEPSImageRep.The size of the object is set from the bounding box specified in the EPS header comments.
- (NSData *)EPSRepresentation
- (NSRect)boundingBox
%%BoundingBox:
" comment
in the EPS header when the NSEPSImageRep is initialized.See Also: + imageRepWithData:, - initWithData:
- (id)initWithData:(NSData
*)epsData
nil
.
Otherwise, it returns self.The size of the object is set from the bounding box specified in the EPS header comments.
- (void)prepareGState