• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to affinely transform an NSView's content
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: How to affinely transform an NSView's content
  • Next by Date: Re: NSOpenPanel -runModalForDirectory:file:types: won't select file
  • Previous by thread: How to affinely transform an NSView's content
  • Next by thread: Re: NSDocumentController recentDocumentURLs hiding non-file based URLs
  • Index(es):
    • Date
    • Thread