Re: saveGraphicsState vs. lockFocus
Re: saveGraphicsState vs. lockFocus
- Subject: Re: saveGraphicsState vs. lockFocus
- From: Scott Thompson <email@hidden>
- Date: Wed, 3 May 2006 09:34:28 -0500
On May 2, 2006, at 3:07 PM, Eric Lin wrote:
I'm a bit confused as to what's the difference between calling
saveGraphicsState (NSGraphicsContext) and lockFocus (NSView). They
appear to be doing something quite similar. Does lockFocus simply
invoke saveGraphicsState?
And when should saveGraphicsState and lockFocus be called? (whenever
I use functions like NSRectFill() and matrix transformation matrix?)
saveGraphicsState is a part of lockFocus, but not the whole thing.
lockFocus does a saveGraphicsState and then arranges the coordinate
system so that the origin is at the lower left or upper left corner
of your view/image (depending on the "isFlipped" state). lockFocus
also ensures, for example, that the clipping state is set properly
for your view.
There may be other stuff that goes on, but hopefully that gives you
the idea.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden