Re: saveGraphicsState vs. lockFocus
Re: saveGraphicsState vs. lockFocus
- Subject: Re: saveGraphicsState vs. lockFocus
- From: Robert Walker <email@hidden>
- Date: Wed, 3 May 2006 12:16:18 -0400
FYI: These concepts are explained pretty clearly in the following
document:
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaDrawingGuide/index.html
Look at the section explaining graphics contexts. It talks about
both saveGraphicsState: and lockFocus: quite thoroughly. In any case
you should read the above document start to finish. It should clear
up a lot of things for you related to drawing.
On May 3, 2006, at 10:34 AM, Scott Thompson wrote:
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:
40mac.com
This email sent to email@hidden
--
Robert Walker
email@hidden
_______________________________________________
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