捕获 UIImagePickerController 的预览
这个问题已经被问过很多次了。但大多数答案不适用于最新的操作系统(3.0+)或者“苹果将拒绝它”。
我需要的是以编程方式抓取 UIImagePickerController 预览中显示的图像,而无需用户拍照并使用该图像 - 我实际需要的是获取我的应用程序的屏幕截图,其中包含背景中的相机和其他前景上的东西。
我尝试了几种方法,最新的方法是:迭代 UIImagePickerController.view 的所有子视图,并使用 [view.layer renderInContext:]
方法将它们保存为图像。通过这种方法,我实际上可以获得控制器的所有资源(按钮等),但我永远看不到实际的预览。有没有人想办法在 3.0+ 中做到这一点?
This has been asked many times. But most answers are not applicable to the latest OS (3.0+) or they are "Apple will reject it".
What I need is to programmatically grab the image displayed in the preview of the UIImagePickerController without having the user take a photo and use the image - what I actually need is to get a screenshot of my app, which contains the camera in the background and other stuff on the foreground.
I have tried several methods, with the latest being: iterate through all the subviews of the UIImagePickerController.view and save them as images using the [view.layer renderInContext:]
method. With this method, I can actually get all the controller's assets (the buttons etc) but I can never see the actual preview. Has anyone figured a way to do this in 3.0+ ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题 1317978 已经回答了这个问题。另外,请查看描述数独解算器中的实时抓取
This has been answered in question 1317978 already. Also, have a look at the blog post describing live grabbing in sudoku solver