• 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: saveGraphicsState vs. lockFocus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: saveGraphicsState vs. lockFocus
      • From: Robert Walker <email@hidden>
References: 
 >saveGraphicsState vs. lockFocus (From: "Eric Lin" <email@hidden>)

  • Prev by Date: Confused with modal sessions
  • Next by Date: Re: Refactoring tools available for Cocoa / ObjC?
  • Previous by thread: Re: saveGraphicsState vs. lockFocus
  • Next by thread: Re: saveGraphicsState vs. lockFocus
  • Index(es):
    • Date
    • Thread