Re: Fill box with repeating text
Re: Fill box with repeating text
- Subject: Re: Fill box with repeating text
- From: Dave Keck <email@hidden>
- Date: Fri, 24 Apr 2009 18:10:05 -1000
> Makes the text transparent, but I can't seem to make the background of the
> NSImage transparent. I want to end up with white text on a transparent
> background, but [[NSImage alloc] initWithSize:[theString size]] seems to set
> the background to solid white.
This is because you're drawing the image incorrectly for your purposes. If you:
[[theImage TIFFRepresentation] writeToFile: [@"~/Desktop/halla.tiff"
stringByExpandingTildeInPath] atomically: YES];
That'll write the image to your desktop. Open it in Preview or
something, and you'll see that the background is, in fact,
transparent. What you want to do instead is use a different
compositing operation when you draw the image. NSCompositeSourceOver
is most likely what you want:
[theImage drawAtPoint: NSZeroPoint fromRect: NSZeroRect operation:
NSCompositeSourceOver fraction: 1.0];
David
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden