• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Punching holes into IKImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Run Loop in Tool Idles for 60.0 seconds before exitting [Solved]
  • Next by Date: Re: Two text fields, one outlet?
  • Previous by thread: Proposal for category in plugin environment
  • Next by thread: Any frameworks for Leopard's Spaces?
  • Index(es):
    • Date
    • Thread