NSImage lockFocus
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