• 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
NSImage lockFocus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage lockFocus


  • Subject: NSImage lockFocus
  • From: email@hidden
  • Date: Sat, 22 Sep 2001 21:51:48 -0400

Once again, hi everyone..

First of all, thanks Ondra for answering my Arrays question.

Now I've taken a look at all the drawing related docs I could find, and it seems to me that one can draw into an NSView even when outside of the drawRect: function as long as one uses the 'lockFocus' call. I also noticed that NSImage has this very same call. So logic would follow that if I locked focus on an NSImage, I could draw into it (provided its size was set correctly beforehand.)

Needless to say, it doesn't seem to work.. I have even gone so far as to try to lockFocusOnRepresentation (after adding an appropriate representation with the proper number of colours and size,) but that fails miserably as apparently NSImageReps do not respond to the -init call!

Is this a hopeless endeavour, or am I missing something very simple here?

-John Stringham


  • Follow-Ups:
    • Re: NSImage lockFocus
      • From: Andrew Platzer <email@hidden>
    • Re: NSImage lockFocus
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: static typing (Learning Cocoa Chapter 13)
  • Next by Date: Project Builder weirdness...
  • Previous by thread: NSImageView and Copy and Paste?
  • Next by thread: Re: NSImage lockFocus
  • Index(es):
    • Date
    • Thread