NSPICTImageRep Class Reference

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

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.

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
  • Available in OS X v10.0 and later.
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
  • Available in OS X v10.0 and later.
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
  • Available in OS X v10.0 and later.
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
  • Available in OS X v10.0 and later.
Declared In
NSPICTImageRep.h