Hi all,

I searched back through 2005 in the Cocoa Mailing List and didn't see any 
requests for this.

We need all the points on a line / arc / path on the screen. We need to do hit 
detection on stroked line, so we must know if the point is valid or not. 

I thought using CGPathContainsPoint would work, but it must be done on a closed 
path or it returns true on all points in the test area. 

I also tried NSBezierPath containsPath: and , but it returned the exact same 
things as the CGPath functions. 

Another idea I have, though not sure if it will work, is converting the drawing 
to NSBitmapImageRep and using colorAtX:y to test for a specific color to test 
for a point.

The downside of this approach is you must test all the points in a bounding 
box, and could get quite large if our line segment is complicated.

I'm surprised I haven't found a convenience method to return all the points in 
an outline.

Any help would be greatly appreciated.

- Cody_______________________________________________

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