iOS:如何将像素从源复制到目标矩形?
程序员们!有没有办法将位图数据从显示器的一个区域复制到另一个区域(如 Windows 中的 bitblt)?
programmers! Is there a way to copy bitmap-data from one region of the display to another (like bitblt in Windows)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无权访问 iPhone 显示屏,但可以访问应用程序显示的任何视图或图像。
您可以从非合成视图中的任何矩形创建子图像,然后在其他位置(在同一视图或另一个视图中)(例如,在drawRect回调中)绘制该子图像。您还可以通过获取指向支持 UIView 的 CGBitmapContext 的指针来获取原始像素数据。
You don't have access to the iPhone display, but you can access any views or images your app is displaying.
You can create a subimage from any rectangle in a non-composited view, and then draw that subimage somewhere else (in the same view, or in another) in, say, a drawRect callback. You can also get at the raw pixel data by getting a pointer to the CGBitmapContext backing a UIView.