Re: How make image nonvibrant in Yosemite NSVisualEffectView
Re: How make image nonvibrant in Yosemite NSVisualEffectView
- Subject: Re: How make image nonvibrant in Yosemite NSVisualEffectView
- From: Eric Schlegel <email@hidden>
- Date: Thu, 30 Oct 2014 15:18:09 -0700
> On Oct 30, 2014, at 12:56 PM, Bill Cheeseman <email@hidden> wrote:
>
> My images are application icons obtained using -[NSWorkspace iconForFile:]. Like most application icons, they usually have irregularly shaped nontransparent areas. I want to create a rectangular mask with a hole in it, where the hole is in the shape of the nontransparent areas of the icon. Ideally a 1-bit mask. Assigning the mask to NSVisualEffectView's maskImage property will allow everything covered by the rectangular mask (namely the whole window) to show vibrancy, except that the area in the hole (namely, the icon shape) will not show vibrancy. At least, that's how I understand the discussion of maskImage in the AppKit Release Note or the WWDC 220 video. (I have already applied a rectangular maskImage with rounded corners, and it removes the square corners from the NSVisualEffectView perfectly.)
One approach you might try is to attach a child window that draws the icons themselves on a transparent background, and doesn’t use an NSVisualEffectView. The parent would would still use an NSVEV and would get the vibrant effect, but the icons in the child window wouldn’t be vibrant.
-eric
_______________________________________________
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