Next Page > Hide TOC

NSAffineTransform Additions Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Companion guide
Declared in
NSAffineTransform.h

Overview

The Application Kit extends Foundation’s NSAffineTransform class by adding:

Note: In Mac OS X v10.3 and earlier the NSAffineTransform class was declared and implemented entirely in the Application Kit framework. As of Mac OS X v10.4 the NSAffineTransform class has been split across the Foundation Kit and Application Kit frameworks.

Tasks

Setting and Building the Current Transformation Matrix

Transforming Bezier Paths

Instance Methods

concat

Appends the receiver’s matrix to the current transformation matrix stored in the current graphics context, replacing the current transformation matrix with the result.

- (void)concat

Discussion

Concatenation is performed by matrix multiplication—see “Manipulating Transform Values”.

If this method is invoked from within an NSView drawRect: method, then the current transformation matrix is an accumulation of the screen, window, and any superview’s transformation matrices. Invoking this method defines a new user coordinate system whose coordinates are mapped into the former coordinate system according to the receiver’s transformation matrix. To undo the concatenation, you must invert the receiver’s matrix and invoke this method again.

Availability
See Also
Related Sample Code
Declared In
NSAffineTransform.h

set

Sets the current transformation matrix to the receiver’s transformation matrix.

- (void)set

Discussion

The current transformation is stored in the current graphics context and is applied to subsequent drawing operations. You should use this method sparingly because it removes the existing transformation matrix, which is an accumulation of transformation matrices for the screen, window, and any superviews. Instead use the concat method to add this transformation matrix to the current transformation matrix.

Availability
Declared In
NSAffineTransform.h

transformBezierPath:

Creates and returns a new NSBezierPath object with each point in the given path transformed by the receiver.

- (NSBezierPath *)transformBezierPath:(NSBezierPath *)aPath

Parameters
aPath

An object representing the bezier path to be used in the transformation.

Discussion

The original NSBezierPath object is not modified.

Availability
See Also
Related Sample Code
Declared In
NSAffineTransform.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-28)


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.