_UIReplicantView and snapshotViewAfterScreenUpdates how to get its content?

前端 未结 1 1842
攒了一身酷
攒了一身酷 2021-01-17 07:31

-renderInContext: has been used widely since its appearance, but with it is impossible to render OpenGL layer, AVPreviewLayer (probably because is a sort of Ope

相关标签:
1条回答
  • 2021-01-17 08:04

    I have struggled with exactly this issue, initially we worked around it by hooking into the NSRunLoop and rendering to an image and then merging them together. It was really messy.

    Then we found a piece of code that would appear to solve this issue, but you have to be prepared to think outside the box a little bit.

    That framework records a video of a UIWindow, we were then just stopping the record. Shoving it through a AVAssetImageGenerator (or something like that), and grabbing the image out.

    As I say it's very much a weird way to solve it, but it seems to work okay for us.

    The code for (ASScreenRecorder) can be found in this library here.

    https://github.com/alskipp/ASScreenRecorder

    One of our menu's in our product was OpenGL and some had video backgrounds! And this worked perfectly for us. But I cant be sure if it was something particular to our implementation and use of OpenGL. It definitely does work for camera views though as his example video's show.

    0 讨论(0)
提交回复
热议问题