Re: NSStatusItem's Image transparency
Re: NSStatusItem's Image transparency
- Subject: Re: NSStatusItem's Image transparency
- From: "Jofell Gallardo" <email@hidden>
- Date: Sat, 7 Oct 2006 15:37:40 +0800
Thanks! This really worked... many thanks!
On 10/7/06, Jim Thomason <email@hidden> wrote:
The Photoshop approach may yield better looking results.
But, if you want to do it in code, something along these lines should
do it. Completely untested.
-(NSImage*) imageFromImage:(NSImage*) image withOpacity:(float) newOpacity
{
NSImage* new = [[NSImage alloc] initWithSize:[image size]];
[new lockFocus];
[image disolveToPoint:NSZeroPoint fraction:newOpacity];
[new unlockFocus];
return [new autorelease];
}
Someone wiser may have a slicker approach.
Note - you'll want to cache those images up in advance or else your
animation would probably be choppy.
-Jim...
On 10/6/06, Jofell Gallardo <email@hidden> wrote:
> Hi guys. I would like to ask if any of you could come up with a solution
on
> setting the status item's transparency. I'm kinda new to doing lockFocus
on
> NSImages, and setting transparency / alpha stuff in them.
>
> I would like to have a status item that "softly blinks" when a
background
> process is being done inside the application.
>
> Many thanks in advance :D
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden