Punching holes into IKImageView
Punching holes into IKImageView
- Subject: Punching holes into IKImageView
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Mon, 5 Apr 2010 15:55:38 +0700
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@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