• 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: NSStatusItem's Image transparency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSStatusItem's Image transparency (From: "Jofell Gallardo" <email@hidden>)
 >Re: NSStatusItem's Image transparency (From: "Jim Thomason" <email@hidden>)

  • Prev by Date: Re: NSArrayController vs. fetch
  • Next by Date: (no subject)
  • Previous by thread: Re: NSStatusItem's Image transparency
  • Next by thread: Re: NSStatusItem's Image transparency
  • Index(es):
    • Date
    • Thread