快速 iPhone 屏幕捕获
我们使用 UIGetScreenImage
每秒捕获 3-6 个图像并将其保存到磁盘。然而,我们正在寻找一种以更快的速度捕获图像的方法。我们注意到一些实现似乎不使用 UIGetScreenImage
(我们知道这一点是因为它们在预览中覆盖了未在图像上捕获的控件),并且它们能够捕获最多每秒 15 张图像并保存到磁盘。是否有其他方法可以比 UIGetScreenImage 更快的速度捕获和保存图像?
We're using UIGetScreenImage
to capture 3-6 images per second and save them to disk. However, we are looking for a way to capture images at a faster rate. We've noticed some implementations that appear not to use UIGetScreenImage
(we know this because they're overlaying controls in the preview that isn't captured on the image) and they're able to capture up to 15 images per second and save to disk. Is there another way to capture and save images at a faster rate than UIGetScreenImage
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用quartz 渲染正在绘制的视图的离屏版本。目前我还不清楚具体的细节,但我相信您需要在视图的绘制方法中获取不同的上下文,并将副本绘制到某个位置,然后将其保存。
该文档可能有更多信息:http://developer.apple.com/mac/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_context/dq_context.html#//apple_ref/doc/uid/TP30001066-CH203 -SW9
You can use quartz to render an off screen version of the view being drawn. the exact details escape me at the moment, but I believe you need to grab a different context in your view's draw method, and draw a copy to some place where you would then save it.
This doc may have more info: http://developer.apple.com/mac/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_context/dq_context.html#//apple_ref/doc/uid/TP30001066-CH203-SW9
您可以尝试使用此处讨论的
ScreenCaptureView
类。You can try using the
ScreenCaptureView
class discussed here.