-3

I have two png files that have some transparent areas in them. I want to check if the non transparent parts are colliding.

CGRectIntersectsRect doesn't work for me.

Is this possible?

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
Andrew
  • 103
  • 7

2 Answers2

0

You don't provide much information about the context, but if performance isn't an issue you could just compare the images pixel by pixel to see where transparent and non-transparent pixels are overlapping.

See this answer here to see how to get access to the actual pixel information based on a UIImage. https://stackoverflow.com/a/7101544/974782

Community
  • 1
  • 1
immichs
  • 113
  • 1
  • 9
0

break it into 2 pieces:

  1. get a outlining CGPath from the images

  2. see, if the paths intersects each other.

For both you should find some codes.

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178