• 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
Re: Touch: Non-rectangular Touch areas
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Touch: Non-rectangular Touch areas


  • Subject: Re: Touch: Non-rectangular Touch areas
  • From: "Henry McGilton (Boulevardier)" <email@hidden>
  • Date: Sat, 6 Feb 2010 13:44:38 -0800

On Feb 6, 2010, at 11:28 AM, Paul Sanders wrote:

> Perhaps you could use separate images and convert them to
> monochrome, saving them as 1 bpp bitmaps (aka masks).  Memory
> should not then be an issue.
>
> Paul Sanders.
>
> ----- Original Message -----
> From: "Andrew Farmer" <email@hidden>
> To: "Jens Alfke" <email@hidden>
> Cc: <email@hidden>
> Sent: Saturday, February 06, 2010 7:19 PM
> Subject: Re: Touch: Non-rectangular Touch areas
>
>
> Another simple approach is to use an image to do hit testing.
> You can either create a bitmap image for each touchable area, or
> a single image with a different color for each target, then test
> the color at the target point to determine membership. My only
> concern with using this approach on iPhone might be the memory
> usage of that image.

You could consider representing each of your trapezoids (or, for
that matter, any arbitrary shape) via a CGPath object, and then use
        CGPathContainsPoint
for your hit testing . . .

    Cheers,
        . . . . . . . .    Henry




=================================================
iPhone App Development and Developer Education . . .
        Visit  www.nonatomic-retain.com

Mac OSX Application Development, Plus a Great Deal More . . .
        Visit  www.trilithon.com

_______________________________________________

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

  • Follow-Ups:
    • Re: Touch: Non-rectangular Touch areas
      • From: Development <email@hidden>
References: 
 >Touch: Non-rectangular Touch areas (From: Development <email@hidden>)
 >Re: Touch: Non-rectangular Touch areas (From: Jens Alfke <email@hidden>)
 >Re: Touch: Non-rectangular Touch areas (From: Andrew Farmer <email@hidden>)
 >Re: Touch: Non-rectangular Touch areas (From: "Paul Sanders" <email@hidden>)

  • Prev by Date: Re: Mixing TableView Bindings
  • Next by Date: NSLayoutManager vertical offset mystery
  • Previous by thread: Re: Touch: Non-rectangular Touch areas
  • Next by thread: Re: Touch: Non-rectangular Touch areas
  • Index(es):
    • Date
    • Thread