Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top