• 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: image opacity?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: image opacity?


  • Subject: Re: image opacity?
  • From: Michael Vannorsdel <email@hidden>
  • Date: Sun, 11 May 2008 02:26:19 -0600

NSView and subclasses have a setAlphaValue: that might do what you want. It requires a backing Core Animation layer (CALayer) and therefore is Leopard only. You can have IB setup the layer backing by setting the view's Wants Core Animation Layer under Effects of the Inspector window; I think Content View is the one to enable it on. You can do it programatically with setWantsLayer:YES as well. Then you use the animator proxy like:

[[NSAnimationContext currentContext] setDuration:2.0]; //2 second fade
[[imageView animator] setAlphaValue:1.0f]; //fade in view to full opacity


Alternately you can subclass the NSImageView or make your own NSView subclass and override drawRect: to vary the drawn image's opacity. If you're adventurous you can use Core Image to do an accelerated fade for Tiger and up.


On May 11, 2008, at 1:03 AM, Patrick J. Collins wrote:

Does anyone happen to know how one could set the opacity of an
NSImageView object?  I am looking for a way to simply fade in an image
on within my app's window-- but neither of the NSImageView nor
IKImageView list anything about opacity...

_______________________________________________

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


  • Follow-Ups:
    • Re: image opacity?
      • From: Jim Puls <email@hidden>
References: 
 >image opacity? (From: "Patrick J. Collins" <email@hidden>)

  • Prev by Date: image opacity?
  • Next by Date: Re: Sleep Display
  • Previous by thread: image opacity?
  • Next by thread: Re: image opacity?
  • Index(es):
    • Date
    • Thread