Re: Darken image
Re: Darken image
- Subject: Re: Darken image
- From: Tom Waters <email@hidden>
- Date: Thu, 19 Jul 2001 15:30:42 -0700
hmm... i cut/pasted from my nsview drawrect method... so it should work
fine... let me cons up a more complete example... hang on.
On Thursday, July 19, 2001, at 03:18 PM, Andreas Monitzer wrote:
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"