Re: Compositing text into an NSImage
Re: Compositing text into an NSImage
- Subject: Re: Compositing text into an NSImage
- From: Philip Dow <email@hidden>
- Date: Sat, 14 Jan 2006 13:54:21 +0100
Hi Simone,
NSString and NSAttributedString both have drawInRect /
drawInRect:withAttributes and drawAtPoint /
drawAtPoint:withAttributes methods. You'll want to use those. In
addition, you may need to get the size of these strings if you want
to, say, center your text. Use size and sizeWithAttributes.
To actually do the drawing, lock focus on your image, draw the text,
and then unlock focus on the image.
-Phil
On Jan 14, 2006, at 12:35 PM, Simone Manganelli wrote:
Simple question: I'm doing some drawing commands to draw some PNG
images into an NSImage, but I also want to be able to dynamically
create some text on the fly and composite it into the image as
well. How do I do this? I've looked in NSText and NSTextField,
but there doesn't seem to be any compositeToPoint: or
dissloveToPoint: or similar methods.
-- Simone
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden