Drawing a String into a NSImage/NSImageRep ...

maccatalan

Registered
Hi.

I would like to make my application dock icon to display some info. But for that I need to know how to draw a NSString into a NSImage or a NSImageRep (if I understood correctly how does that work).

My problem is that I know how to draw a NSString into a NSView but not a NSImage/NSImageRep.

Thank you for you help,
Pierre.
 
You do it the same way you would with a view. Lock the focus on the NSImage, use drawAtPoint:withAttributes or drawInRect:withAttributes (whichever you are using), then unlock the focus on the image.
 
Back
Top