Re: Compositing text onto an NSImageView
Re: Compositing text onto an NSImageView
- Subject: Re: Compositing text onto an NSImageView
- From: Stéphane Sudre <email@hidden>
- Date: Fri, 8 Jun 2001 13:23:13 +0200
On vendredi, juin 8, 2001, at 09:49 AM, Will Price wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have an NSImageView with an image in it. I now want to place text
overlayed on top of the image rotated at a 45 degree angle similar to
a watermark.
I'm very foggy on what I would need to do this. I get the feeling it
involves something to do with an NSBezierPath and I'm not sure what I
do to get the text onto the image...
Any pointers on how I should proceed here?
Do you want the NSImage to keep this "watermark" or not ?
If the answer is no, one solution might be to a put a custom subclass of
a NSView on top of the NSImageView
Rotate the View using - (void)rotateByAngle:(float)angle;
and in the - (void) drawRect:(NSRect) frame; method of your custom
subclass, draw a string.
If you're lazy or like optimization, simply add a NSTextField with
tranparent background and do the rotate stuff.