O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PhotoCamera

The advantage of the PhotoCamera class is that it gives control over the flash and autofocus when capturing images.

PhotoCamera is usually defined as a field in a page or viewmodel and then instantiated when needed. The device camera needs time to ready itself for use and cannot be used until it is initialized, indicated by an Initialized event. Initialization commences when the PhotoCamera is assigned to the source of a VideoBrush, using its SetSource method.

Note

Failure to call VideoBrush.SetSource with the PhotoCamera instance prevents the Initialized event from being raised.

The following example shows how to create and initialize a PhotoCamera using a VideoBrush within a PhoneApplicationPage:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required