faqts : Computers : Programming : Application Frameworks : Macintosh : Cocoa

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

52 of 52 people (100%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

How can I put or write text into an NSImage?

Apr 29th, 2002 19:43
Christopher Holland, David Remahl


NSImage *yourImg = [NSImage imageNamed:@"Whatever"];
[yourImg lockFocus];
[@"Your string" drawAtPoint:NSMakePoint(0,0)] 
[yourImg unlockFocus];
// See NSStringDrawing.h for alternatives or 
// <AppKit/NSAttributedString.h> for attributed string drawing