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

7. Working with Images > Using a Custom Camera Overlay

Using a Custom Camera Overlay

Custom overlays create a GUI that floats over the live camera preview. You can add buttons and other user interface controls to snap photographs and dismiss the controller. Figure 7-5 shows a rudimentary overlay with two buttons: one for snapping a photo, the other (the small circled “X”) for dismissing the image picker controller. Notice the black bar behind the overlay and under the camera preview. The overlay is deliberately offset to highlight this bar. Hiding the standard controls leaves this black bar in place. You’ll want to design your overlay to best take advantage of this geometry.

image

Figure 7-5. Snapping photos with a custom image picker overlay.

Set the overlay by assigning a view to the picker’s cameraOverlayView property and hide the normal controls. When you present the picker, the custom overlay, not the built-in one, appears. You’ll want to match your custom camera overlay to the screen properties of the device you’re working with.


  

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