Re: Darken image
Re: Darken image
- Subject: Re: Darken image
- From: Andreas Monitzer <email@hidden>
- Date: Fri, 20 Jul 2001 00:18:40 +0200
On Thursday, July 19, 2001, at 11:12 , Tom Waters wrote:
Here's how I do it in FileView (one of the many "everybody else" apps)
You need to make a copy of the image, using NSCompositeCopy, then do a
rectFill over the top of it using semi-transparent black (or any other
color if you want to tint it) using NSCompositeSourceAtop, then use that
copy of the image just as you would the original.
Here's my code with some other stuff hacked out of it, but I think it
should still compile. (note that I cache that image alloc/init in a
singleton, but i just left it in here to make the example simpler)
Hm... using your example, the image looks pretty well when used for NSView'
s dragImage:at:offset:event:pasteboard:source:slideBack:, but draws a
black background when used in NSView's drawRect:. Looks pretty strange to
me, where's the difference?
andy
--
"He was addicted to life. But we cured him"