I have an IKImageView and would like to create holes, i.e. set alpha to zero in 
some rectangle.
And then save the result in some format.

What would be the easiest way to do this?

1. Create a CIFilter and do:
        myIkImageView.imageCorrection = myHoleFIlter
        save myIkImageView

2. 
        CGImageRef cgImage = [ myIkImageView image ];
        NSBitmapImageRep  *bp = [ [NSBitmapImageRep alloc ] initWithCGImage: 
cgImage];
        NSColor *c = [ NSColor clearColor];
        for the intended rectangle do: [ bp setColor: c atX: ... y: ...];
        CGImageRef new = [ bp CGImage ];
        [ myIkImageView setImage: new  imageProperties: ...];
        save myIkImageView

3.      Something else? Maybe just use an existing filter 
(CISourceOverCompositing ?) to put a clear rectangle on top?


Efficiency is not the prime concern. It would be acceptable if it takes a few 
seconds to create a hole.
I have no experience with CIFilter yet.


Kind regards,

Gerriet.

_______________________________________________

Cocoa-dev mailing list ([email protected])

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