I am trying to get a UIImage from what is displayed in my EAGLView. Any suggestions on how to do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
EDIT: 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.An
EAGLViewis just a kind of view, and its underlyingCAEAGLLayeris 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.)