Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 7. Working with Images > Taking View-based Screenshots

Taking View-based Screenshots

At times you need to take a shot of a view or window in its current state. Listing 7-3 details how you can draw views into image contexts and retrieve UIImage instances. This code works by using Quartz Core’s renderInContext call for CALayer instances. It produces a screenshot not only of the view but of all the subviews that view owns.

There are, of course, limits. You cannot screenshot the entire window (the status bar will be missing in action) and, using this code in particular, you cannot screenshot videos or the camera previews. OpenGL ES views also may not be captured.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial