Re: How to affinely transform an NSView's content
Re: How to affinely transform an NSView's content
- Subject: Re: How to affinely transform an NSView's content
- From: Steve Streza <email@hidden>
- Date: Fri, 20 Apr 2007 09:26:09 -0400
Hey Ewan,
NSAffineTransform is a great tool, but getting started with it can be a
bit of a pain. To use it, you need to call [myAffineTransform concat]
within your drawRect method. What this will do is take all of the
existing affine transforms (if there are any created by the system), do
all of the calculation involved, and apply the new coordinate system to
the view.
I'm pretty certain that you can call the concat method anywhere within
your drawRect method (including after you've put some drawing code), but
someone more familiar with the topic would be able to help you better.
For reference, check out:
NSAffineTransform class reference:
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSAffineTransform_Class/Reference/Reference.html
NSAffineTransform AppKit category:
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSAffineTransform_AppKitAdditions/Reference/Reference.html
Cocoa Drawing Guide (specifically the section called Coordinate Systems
and Transforms):
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/index.html
HTH,
Steve Streza
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden