1

Can I know if a CGPoint is inside a CGImageRef? Or I should convert CGImageRef in other format?

UPDATE

maskcontext = CGBitmapContextCreate(currentM, w, 
                                               h,
                                               bitsPerComponent, bytesPerRow, colorSpace,
                                               kCGImageAlphaNone);
maskImage = CGBitmapContextCreateImage(maskcontext);

where currentM is an unsigned char, maskcontext is a CGContextRef and maskImage is a CGImageRef and I want to know its rect.

sch
  • 27,436
  • 3
  • 68
  • 83
cyclingIsBetter
  • 17,447
  • 50
  • 156
  • 241
  • I have a cgimageref where I color this image; and I want to know when i touch the device; if the touch is inside this cgimageref or not – cyclingIsBetter Mar 08 '12 at 09:51

1 Answers1

2

Can you get the frame of your image? Then you could do:

CGRectContainsPoint ( CGRect rect, CGPoint point )

To see if that point is inside that frame.

Antonio MG
  • 20,382
  • 3
  • 43
  • 62