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 8:31 AM, Mike Kluev wrote:

On 31/01/2007 07:08 Pm, Eric Schlegel wrote:

The plugin case is actually a good example of why saving and
restoring the gstate really is the better way to go.

Your comment is that the context might have a non-identity CTM on
entry to the plugin, and therefore saving and restoring the CTM won't
get you back to identity. But typically, you wouldn't _want_ to get
back to identity in that case. The CTM has been set up by the host
application in whatever way that the host app deems appropriate.
Maybe the host app is displaying a magnified view of the plugin
content so it's passing in a CTM with a 2x magnification. If you
revert all the way back to an identity matrix, you'll lose the
magnification. You really want to revert back to the CTM state that
the host app provided.

Good point. BTW, Steve didn't told us *why* does he need identity matrix...

In this particular case I'm calling ClearRectangle to erase the entire bitmap in a CGBitmapContext before doing further transformed drawing. The hitch is that the context may have already been transformed away from its identity matrix. After doing all this drawing, the bitmap is then copied into a destination context and the process is repeated. The second hitch is that I'm playing with the pixels in each of these layers, so I can't just clear once and draw all the layers.




_______________________________________________
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>)



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.