Re: dock tile overlay image
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