Re: Semi-transparent, blurred NSWindow background?
Re: Semi-transparent, blurred NSWindow background?
- Subject: Re: Semi-transparent, blurred NSWindow background?
- From: Jonathan Dann <email@hidden>
- Date: Mon, 25 Aug 2008 20:19:33 +0100
On 25 Aug 2008, at 16:58, Tim Andersson wrote:
24 aug 2008 kl. 23.20 skrev Jonathan Dann:
On 24 Aug 2008, at 17:45, Tim Andersson wrote:
YMMV but I'd start with a window as shown in this sample code
http://developer.apple.com/samplecode/RoundTransparentWindow/index.html
and then replace the view with a custom view, and apply a CI filter
as shown here
http://www.kickingbear.com/blog/?m=200803
Hope this helps, let me know how you get on if that's ok?
Jonathan
http://espresso-served-here.com
I'm not getting on very well.. I don't understand how I'm supposed
to apply the CIFilter to my custom view. What is the "concept" of
applying the filter? For example, the concept of applying a CIFilter
to a CIImage is roughly: Create a CIContext which will draw the
image, create an CIImage, "apply" the CIFilter and draw the image
using the CIContext.
Many thanks,
Tim Andersson
That sounds right to me.
It seems that you will have to make a transparent custom view and a
transparent window. From there you make the view the content view of
your transparent window. When it comes to drawing your transparent
view you need to draw into CGLayers. As demonstrated in the sample
code on http://www.kickingbear.com/blog/?m=200803 draw your view first
into a GCLayer, see -lockFocusOnViewLayer. Then lock focus on your
own custom view's "mask" layer and fill the bounds of your view with
[NSColor whiteColor]. Then you have the job of post processing what
you just filled (the mask image).
The steps in the application of a CIIFilter to an image are described
here:
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/CoreImaging/ci_tasks/chapter_3_section_5.html#/
/apple_ref/doc/uid/TP30001185-CH203-BAJDDCEE
which I won't re-hash 'cos I'm not confident enough with CoreImage not
to butcher it. But have a look at the sample code on the kickingbear
blog, the application is carried out in the -[KBPostProcessedTableView
applyPostProcess] methods. Which creates a CIFilter with
CIBlendWithMask, and draws the output image into a CIContext.
Hope that's a little clearer.
Jonathan
http://espresso-served-here.com
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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