• 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: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps?


  • Subject: Re: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps?
  • From: Graham Cox <email@hidden>
  • Date: Wed, 28 Oct 2009 17:00:15 +1100


On 28/10/2009, at 4:49 PM, Peter N Lewis wrote:

So in order to convert from using IconRef to using NSImage for everything (after loading the IconRef), I need to know how to:

a) composite two images, preferably while keeping the different resolutions of the icon
b) how to dim an image similarly to kTransformDisabled


Any suggestions?

Google didn't find much useful for either NSImage & compositing or NSImage & kTransformDisabled.


I'm unclear what you mean by a), but certainly compositing NSImage into another one or into a view/context is trivial.

On b), you'd probably have to experiment but I would bet that a straightforward combination of the compositing operation and the alpha value would achieve this. It's been a good long while since I wrote anything in Carbon, but I seem to recall that the disabled look was a lowered contrast, semi-grayed appearance. If that's the case, you can easily get that using the above.

In both cases the method to use is - drawInRect:fromRect:operation:fraction:

Once you've determined the magic numbers, it would be easy to add an NSImage category to draw them using the same icon drawing constants used for IconRefs.

--Graham


_______________________________________________

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: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps?
      • From: Peter N Lewis <email@hidden>
References: 
 >Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps? (From: Dalmazio Brisinda <email@hidden>)
 >Re: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps? (From: Kyle Sluder <email@hidden>)
 >Re: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps? (From: Peter N Lewis <email@hidden>)

  • Prev by Date: Re: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps?
  • Next by Date: Re: Core Data: Undoing Cut-Paste, Drag-Drop between documents
  • Previous by thread: Re: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps?
  • Next by thread: Re: Cocoa replacement for Carbon CompositeIconRef() for Snow Leopard 64-bit apps?
  • Index(es):
    • Date
    • Thread