如何从EAGLView获取UIImage? [英] How to get UIImage from EAGLView?

查看:210
本文介绍了如何从EAGLView获取UIImage?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从我的EAGLView中显示的内容中获取UIImage。关于如何做到这一点的任何建议?

I am trying to get a UIImage from what is displayed in my EAGLView. Any suggestions on how to do this?

推荐答案

编辑:作为下面的demianturner说明,你不再需要渲染图层,你可以(而且应该)现在使用更高级别的 [UIView drawViewHierarchyInRect:] 。除此之外;这应该是一样的。

as demianturner notes below, you no longer need to render the layer, you can (and should) now use the higher-level [UIView drawViewHierarchyInRect:]. Other than that; this should work the same.

一个 EAGLView 只是一种视图,其基础 CAEAGLLayer 只是一种层。这意味着,用于将视图/图层转换为UIImage的标准方法将工作。 (关联的问题是UIWebview并不重要;这只是另一种观点。)

An EAGLView is just a kind of view, and its underlying CAEAGLLayer is just a kind of layer. That means, that the standard approach for converting a view/layer into a UIImage will work. (The fact that the linked question is UIWebview doesn't matter; that's just yet another kind of view.)

这篇关于如何从EAGLView获取UIImage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆