Re: Compositing text over images
Re: Compositing text over images
- Subject: Re: Compositing text over images
- From: Esteban Uribe <email@hidden>
- Date: Mon, 24 Mar 2003 13:12:54 -0800
Hi John,
On Monday, March 24, 2003, at 12:05PM, John Timmer <email@hidden> wrote:
>
I'd like to composite a bit of text on top of an NSImage, keeping the result
>
as an NSImage. From poring over the docs, it seems like the way to do this
>
would be to composite both to an NSView, then recover the image using
>
NSView's dataWithPDFInsideRect: method to derive the resulting image. Is
>
this accurate, or have I missed something?
The best way to do this is to draw offscreen, create an NSImage and lockfocus on it
Draw your NSImage first so that its in the background.
Then call NSString's drawAtPoint:withAttributes: or drawInRect:withAttributes:
(Both are AppKit additions to NSString)
Then unlock focus on the NSImage
Then use the resulting NSImage as you wish...
-Esteban
_______________________________________________
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.