Snapshot fails on some iOS devices

344 views Asked by At

I've got an app where I have a GLKit View Controller. I need to get a snapshot of the GL view.

I'm using:

glImage = [(GLKView *)self.view snapshot] ;

where glImage is a UIImage.

It works fine every time on my iPhone 5s (iOS 8.1), but just gives a blank image on my iPad Mini (iOS 7.1) and my iPhone 4s (also 7.1). The image is exactly the size I'd expect but blank.

This feature has been in place since iOS5 so it doesn't look like an OS issue.

Why doesn't this work? Is it a processing issue?

Edit - I upgraded the iPad to iOS8.1 and the problem remains so definitely not an OS issue.

1

There are 1 answers

0
Karol Czaradzki On

It's not exact answer but you may consider using this method:

In short words it attaches CVPixelBuffer to OpenGL Framebuffer which allows it to be read quickly by CPU. I am using it to capture video and never had problems with it. Also it may be quicker then snapshot since it does not require your view to be redrawn.