Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Hit Testing

Hit testing is a generic term for any procedure that determines whether a mouse click occurs inside a shape or area. Quartz provides two solutions for hit testing:

When you are hit-testing, you may need to know the transform that Quartz uses to map between user and device space. The function CGContextGetUserSpaceToDeviceSpaceTransform, introduced in Mac OS X v10.4, returns the affine transform that maps user space to device space in a graphics context. There are other convenience functions for transforming points, sizes, and rectangles between these two coordinate spaces. For example, CGContextConvertPointToUserSpace transforms a point from the device space of a context to its user space.

Contents:

Using a Path for Hit Testing
Using a 1x1 Bitmap Context for Hit Testing
Relevant Resources




< Previous PageNext Page > Hide TOC


Last updated: 2006-09-05




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice