25 aug 2008 kl. 06.13 skrev Rob Keniger:

>In 10.5 you can add any core image filter to a window using the
>private function 'CGSAddWindowFilter'.
>
>typedef void * CGSConnectionID;
>
>extern OSStatus CGSNewConnection(const void **attr, CGSConnectionID
>*id);
>
>- (void)enableBlurForWindow:(NSWindow *)window
>{
>
>CGSConnectionID _myConnection;
>uint32_t __compositingFilter;
>
>int __compositingType = 1; // Apply filter to contents underneath the
>window, then draw window normally on top
>
>/* Make a new connection to CoreGraphics, alternatively you could use
>the main connection*/
>
>CGSNewConnection(NULL , &_myConnection);
>
>/* The following creates a new CoreImage filter, then sets its options
>with a dictionary of values*/
>
>CGSNewCIFilterByName (_myConnection, (CFStringRef)@"CIGaussianBlur",
>&__compositingFilter);
>NSDictionary *optionsDict = [NSDictionary dictionaryWithObject:
>[NSNumber numberWithFloat:3.0] forKey:@"inputRadius"];
>CGSSetCIFilterValuesFromDictionary(_myConnection, __compositingFilter,
>(CFDictionaryRef)optionsDict);
>
>/* Now just switch on the filter for the window */
>
>CGSAddWindowFilter(_myConnection, [window windowNumber],
>__compositingFilter, __compositingType );
>}
>
>Insert standard disclaimer about using private Apple APIs here.
>
>--
>Rob Keniger

Thanks for your help, but I'd like to stay away from the private APIs. :)

//Tim Andersson

PS. If this reply doesn't end up in my "thread", it's because your mail didn't end up in my inbox, so I had to create this email from scratch DS.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to