相关疑难解决方法(0)

如何从UIImage(Cocoa Touch)或CGImage(Core Graphics)获取像素数据?

我有一个UIImage(Cocoa Touch).从那以后,我很高兴得到一个CGImage或其他你想要的东西.我想写这个函数:

- (int)getRGBAFromImage:(UIImage *)image atX:(int)xx andY:(int)yy {
  // [...]
  // What do I want to read about to help
  // me fill in this bit, here?
  // [...]

  int result = (red << 24) | (green << 16) | (blue << 8) | alpha;
  return result;
}
Run Code Online (Sandbox Code Playgroud)

谢谢!

cocoa cocoa-touch core-graphics

196
推荐指数
9
解决办法
14万
查看次数

标签 统计

cocoa ×1

cocoa-touch ×1

core-graphics ×1