Re: Writing on an NSImage
Re: Writing on an NSImage
- Subject: Re: Writing on an NSImage
- From: David Remahl <email@hidden>
- Date: Mon, 29 Apr 2002 15:13:02 +0200
>
Hello,
>
>
Any ideas as to how I would go about writing text onto an NSImage??
>
>
I am loading a picture from the disk, and would like to add text to it but
>
have no clue as to how I would do that... Though I know that it is possible
>
to add an image to another, so at worst I could have a bitmap for each
>
letter and manually add each in turn as I write, but this is a shoddy
>
solution.
>
>
Any help would be great,
>
>
Matt Smith
NSImage *yourImg = [NSImage imageNamed:@"Whatever"];
[yourImg lockFocus];
[@"Your string" drawAtPoint:NSMakePoint(0,0)] // See NSStringDrawing.h for
alternatives or <AppKit/NSAttributedString.h> for attributed string drawing
[yourImg unlockFocus];
/ Rgds, David
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.