• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Darken image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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"


References: 
 >Re: Darken image (From: Andreas Monitzer <email@hidden>)

  • Prev by Date: Re: Darken image
  • Next by Date: Re: Darken image
  • Previous by thread: Re: Darken image
  • Next by thread: Re: Darken image
  • Index(es):
    • Date
    • Thread