# Drawing a String into a NSImage/NSImageRep ...



## maccatalan (Oct 18, 2004)

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.


----------



## Darkshadow (Oct 19, 2004)

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.


----------



## maccatalan (Oct 19, 2004)

hmmm .... pretty simple ... I really love Cocoa !  

Thank you for your help,
Pierre.


----------

