3

This question is an extension of: Taking Screenshots from iOS app - emulating Display recorder (query on the internals)
There are 2 ways, I came across to take screenshots from the background -

  1. Creating an image out of the ios surface and saving it - it captures at a very fast rate (approximately 0.2-0.3 sec/ 12-15 screenshots), however there are some problems that are encountered, discussed here: Releasing an IOSurface

  2. The following code does the same job using the createScreenIOSurface API:

    IOSurfaceRef surface = [UIWindow createScreenIOSurface]; UIImage *surfaceImage = [[UIImage alloc] _initWithIOSurface:surface orientation:UIImageOrientationUp]; CFRelease(surface); UIImageSaveToPhotosAlbum(surfaceImage, self, nil, nil);

However, the capture rate is very bad, approximately 0.5-0.7 sec/screenshot.

So, is there a solution to the problem faced in approach 1 ?
Is there a way to improve performance for approach 2 ?

Rizwan
  • 103
  • 4
  • 24
Hrishikesh_Pardeshi
  • 995
  • 4
  • 19
  • 45

0 Answers0