Re: Fill box with repeating text
Re: Fill box with repeating text
- Subject: Re: Fill box with repeating text
- From: Trygve Inda <email@hidden>
- Date: Sat, 25 Apr 2009 04:35:04 +0000
- Thread-topic: Fill box with repeating text
>> 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];
Where does this go as it is drawing the image, not the text? The image is
drawn with a RectFill call??
Trygve
_______________________________________________
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