0

I really need to capture a CAEmitterLayer as an image to render in my context. I know that renderInContext method does not suport CAEmitterLayer, i have found many questions about it but no good answers.

I was able to achieve my goal by using new iOS7 method drawViewHierarchyInRect, it worked just fine, but i need my app running on iOS6 as well.

There is any way at all to do that? Can i, programmatically, take a screenshot like when i press homebutton + powerbutton on device?

Any help will be useful, i'm on a dead alley with this.

douglasd3
  • 761
  • 2
  • 10
  • 27

1 Answers1

0

I got the same problem, the CAEmitterLayer can not be "renderincontext", but i read a blog, at last the author said there is a way to draw it,and output a image to show,here is the blog for you. http://www.raywenderlich.com/6063/uikit-particle-systems-in-ios-5-tutorial

wendy
  • 1
  • Please post a more complete answer, if the link ever goes down this answer won't be very useful. – John V. Nov 25 '13 at 09:50
  • I've seen this post, but he didn't show how to, he just told that is possible. In the end i kind of created my own particle emitter system, it was not perfect but worked well for my app. – douglasd3 Nov 25 '13 at 12:39
  • i find a method can capture the screen, it used like this " CGImageRef UIGetScreenImage(); CGImageRef img = UIGetScreenImage(); – wendy Nov 26 '13 at 03:34