Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a couple of CGContext questions



On Jan 31, 2007, at 06:46:19, David Duncan wrote:

There is one more very important reason that I didn't touch on before about why you wouldn't want to invert the CTM in order to get back to identity -- the context may not have started out with the identity transformation.

HIView sets up your context such that the CTM gives you a coordinate system that looks like Quickdraw. Take the inverse of the CTM and you will get the default coordinate system instead of the Quickdraw one you may be expecting.

Additionally, there is Resolution Independence. This is generally implemented in the frameworks by scaling the CGContext appropriately -- inverting the CTM will defeat this feature. Someday when your users have control over this feature they will run your application and wonder why some of the drawing is tiny :).

That's why it would be a great idea if there was a call like CGContextRevertToBaseCTM(CGContextRef c) which would set the identity matrix plus whatever normal transforms are needed for RI and such. I haven't needed it, so I haven't submitted a radar requesting it. But the OP might want to.


_________________________________________________________
Steve Mills                              Me: 952-401-6255
Senior Software Architect                         MultiAd
email@hidden                       www.multi-ad.com


_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: a couple of CGContext questions (From: Mike Kluev <email@hidden>)
 >Re: a couple of CGContext questions (From: David Duncan <email@hidden>)
 >Re: a couple of CGContext questions (From: David Duncan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.