• 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: dock tile overlay image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dock tile overlay image


  • Subject: Re: dock tile overlay image
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Sat, 30 Jan 2010 12:07:25 +0100

Le 29 janv. 2010 à 17:02, Felipe Heidrich a écrit :

> Using Carbon I can place overlay images on the application dock tile by
> calling OverlayApplicationDockTileImage().
>
> Is it possible to do the same using Cocoa ?
> I read NSDockTile and NSApplication Class Reference and I'm afraid the
> answer is no.
>
> I could use the old carbon API (OverlayApplicationDockTileImage) but
> fortunately it doesn't work on 64 bits.
>
> Any ideas ?

You can easily compose the image youself.

NSImage *icon = [NSApplication applicationIconImage];
[icon lockFocus];
CGContextRef ctxt = [[NSGraphicsContext currentContext] graphicPort];
CGContextDrawImage(ctxt, myDestRect, myOverlay);
[icon unlockFocus];
[NSApplication setApplicationIconImage:icon];

Note that you will have to backup the original icon image if you want to do this more than one time.

You can also use NSDockTile and use a custom view to draw the application icon and your overlay.


-- Jean-Daniel




_______________________________________________

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

References: 
 >dock tile overlay image (From: Felipe Heidrich <email@hidden>)

  • Prev by Date: Re: Loading of Mach-O executable files.
  • Next by Date: Re: Loading of Mach-O executable files.
  • Previous by thread: dock tile overlay image
  • Next by thread: Working with external drives with Cocoa.
  • Index(es):
    • Date
    • Thread