Getting pixel data from UIImageView — works on simulator, not device

后端 未结 3 390
猫巷女王i
猫巷女王i 2020-12-18 10:24

Based on the responses to a previous question, I\'ve created a category on UIImageView for extracting pixel data. This works fine in the simulator, but not when deployed to

3条回答
  •  既然无缘
    2020-12-18 10:45

    It looks like that in the code posted in the original questions instead of:

    NSUInteger x = (NSUInteger)floor(point.x);
    NSUInteger y = height - (NSUInteger)floor(point.y);
    

    It should be:

    NSUInteger x = (NSUInteger)floor(point.x);
    NSUInteger y = (NSUInteger)floor(point.y);
    

提交回复
热议问题