Re: Transparent color over an image: how to prevent a hole?
Re: Transparent color over an image: how to prevent a hole?
- Subject: Re: Transparent color over an image: how to prevent a hole?
- From: John Timmer <email@hidden>
- Date: Wed, 24 Sep 2003 14:11:35 -0400
I'm afraid that you may have to composite the text and the image onto a new
image, then place the new image into the NSImageView that's holding it. The
code would look something like this:
tempImage = [[NSImage alloc] initWithSize: [regularImage size]];
[tempImage lockFocus];
[regularImage compositeToPoint: NSMakePoint(0, 0) operation:
NSCompositeSourceOver];
[overlayString drawAtPoint: NSMakePoint(8,7)];
[tempImage unlockFocus];
There's definitely some problems with transparency affects blasting through
the underlying view hierarcy. Compositing a raw gif with transparency will
also blow a hole through the underlying window, so if there's a problem with
this happening, it can usually be solved by re-compositing onto a fresh
image.
Cheers,
JT
>
I have some text over an image, and I would like to make the text blink by
>
periodically making it disappear. I tried to do this by setting the
>
NSBackgroundColorAttributeName and NSForegroundColorAttributeName to [NSColor
>
clearColor], but when I do this, the clear color goes right through the image
>
and the window making a hole.
>
>
How do I get the transparency to stop at the image?
_______________________________________________
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.