Next Page > Hide TOC

NSPICTImageRep Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in Mac OS X v10.0 and later.
Companion guide
Declared in
NSPICTImageRep.h
Related sample code

Overview

An NSPICTImageRep object renders an image from a PICT format data stream as described in the Carbon QuickDraw Manager documentation. This class can render PICT format version 1, version 2, and extended version 2 pictures.

!

Warning:  There is no guarantee that the image will render exactly the same as it would under QuickDraw because of the differences between the display medium and QuickDraw. In particular, some transfer modes and region operations may not be supported.

Tasks

Creating an NSPICTImageRep

Getting Image Data

Class Methods

imageRepWithData:

Creates and returns an NSPICTImageRep object initialized with the specified data.

+ (id)imageRepWithData:(NSData *)pictData

Parameters
pictData

A data object containing the PICT data.

Return Value

An initialized NSPICTImageRep or nil if the object could not be initialized. Initialization may fail if the data does not conform to the PICT file format.

Availability
See Also
Related Sample Code
Declared In
NSPICTImageRep.h

Instance Methods

boundingBox

Returns the rectangle that bounds the receiver.

- (NSRect)boundingBox

Return Value

The rectangle bounding the receiver. This rectangle is obtained from the the picFrame field in the picture header. See the Carbon QuickDraw Manager documentation for information on the picture header

Availability
Declared In
NSPICTImageRep.h

initWithData:

Returns an NSPICTImageRep object initialized with the specified data.

- (id)initWithData:(NSData *)pictData

Parameters
pictData

A data object containing the PICT data.

Return Value

An initialized NSPICTImageRep or nil if the object could not be initialized. Initialization may fail if the data does not conform to the PICT file format.

Discussion

If the PICT data is obtained directly from a PICT file or document, this method ignores most of the 512-byte header that occurs before the start of the actual picture data. It may retrieve some relevant meta information from the header.

Availability
See Also
Declared In
NSPICTImageRep.h

PICTRepresentation

Returns the receiver's PICT data.

- (NSData *)PICTRepresentation

Return Value

A data object containing the PICT data. The returned data does not include the 512-byte header, if it was present in the original data. If you want to write the returned data to a file, you must precede it with a 512-byte header (containing all zeros) if you want to conform to the PICT document format.

Availability
Declared In
NSPICTImageRep.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-01-26)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.