On Feb 6, 2010, at 3:45 PM, Development wrote:

> I really like the sound of this solution. I've never worked with CGPaths, is 
> that anything at all like NSBezierPath?

Conceptually similar, in that a CGPath is the Core Graphics analogue of 
NSBezierPath.
Just like NSBezierPath, you can create essentially any kind of vector-based 
shape that
can be described by a series of move-to-point, line-to-point, arcs, 
arc-to-point, cubic Bézier
curve, and Quadratic Bézier curve . . .

> because it seems like this might be the way to go. Can I use an Image to 
> create a CGPath?

From the subject of your original question I drew a plausible but potentially 
wrong
assumption that the 'Touch' refers to iPhone touches, hence the suggestion to 
use
CGPaths instead of NSBezierPath.

From that assumption I made another one, namely, that somewhere you have
specifications of the shapes of your trapezoids, and that such specifications 
could
then be used as the basis for CGPath objects.   So where are the trapezoids 
coming
from?    Are they simply arbitrary random images with no underlying vector 
specifications?

If you have specifications, there might not be any need for images at all, or, 
if images are
actually required for whatever reason, they could additionally be manufactured 
on the fly
by drawing into Core Graphics Image Contexts . . .

Maybe clarify the problem specification a little . . .

    Cheers,
        . . . . . . . .    Henry




> 
> 
> On Feb 6, 2010, at 2:44 PM, Henry McGilton (Boulevardier) wrote:
> 
>> 
>> 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" <andf...@gmail.com>
>>> To: "Jens Alfke" <j...@mooseyard.com>
>>> Cc: <cocoa-dev@lists.apple.com>
>>> 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 (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/development%40fornextsoft.com
>> 
>> This email sent to developm...@fornextsoft.com
> 

=================================================
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 (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 arch...@mail-archive.com

Reply via email to