LUMIA APP LABS: CREATE STUNNING IMAGING APPS FOR LUMIA PHONES

Post on 12-Jan-2015

3,329 views 3 download

Tags:

description

The Nokia Lumia 920 with Windows Phone 8 is setting the standard in smartphone-imaging technology. In these webinar slides, you’ll learn about creating stunning imaging apps that use the advancements in the Lumia 920 and the potential of the new Microsoft Windows Phone 8. You’ll learn how to capture superb images and video, control ISO and other parameters, perform multiframe image capture, get direct access to sensor data, and apply special effects. The Windows Phone 8 native camera app includes a feature called ‘lenses’ that makes it easy for users to apply the effects produced by your apps. The presentation explains how you make your apps part of this seamless user experience.

transcript

CREATE STUNNING IMAGING APPS

Berthier Lemieux Technology Wizard

LUMIA APP LABS #4

TYPICAL CAMERA USE CASES.

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

WP7.5 WP8

IMAGE PICKER X X

AUGMENTED REALITY VIEWFINDER X X

PRO-CAMERA X

FILTERS X

IMAGE PICKER

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

KEY APIS:

Microsoft.Phone.Tasks.PhotoChooserTask Microsoft.Phone.Tasks.CameraCaptureTask

Example code: http://tinyurl.com/cqlezbn

IMAGE PICKER

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

private void CameraRoll_Click(object sender, RoutedEventArgs e) { PhotoChooserTask objPhotoChooser = new PhotoChooserTask(); objPhotoChooser.Completed += objPhotoChooser_Completed; objPhotoChooser.ShowCamera = true; objPhotoChooser.Show(); } void objPhotoChooser_Completed(object sender, PhotoResult e) { switch (e.TaskResult) { case TaskResult.OK: PickedImage.Source = new BitmapImage(new Uri(e.OriginalFileName)); break;

...

AR VIEWFINDER

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

Example code: http://tinyurl.com/c3sdyqa

KEY API:

Microsoft.Devices.PhotoCamera Microsoft.Devices.Sensors.Motion System.Windows.Media.VideoBrush

DISPLAY THE CAMERA FRAMES

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

<Grid x:Name="LayoutRoot" Background="Transparent"> <Rectangle Width="640" Height="480" Canvas.ZIndex="1"> <Rectangle.Fill> <VideoBrush x:Name="viewfinderBrush" /> </Rectangle.Fill> </Rectangle> </Grid>

cam = new Microsoft.Devices.PhotoCamera(); viewfinderBrush.SetSource(cam);

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

ROLL

PITCH

YAW

See also Petzold: http://tinyurl.com/cgydz3u

AR VIEWFINDER

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

motion = new Motion(); motion.TimeBetweenUpdates = TimeSpan.FromMilliseconds(20); motion.CurrentValueChanged += motion_CurrentValueChanged; motion.start(); ...

private void CurrentValueChanged(MotionReading reading) {

// Phone has moved, update the overlays on the screen according to // reading.Attitude.RotationMatrix

KEY API:

Windows.Phone.Media.Capture.PhotoCaptureDevice Windows.Phone.Media.Capture.CameraCaptureSequence

PRO-CAMERA

Example code: HTTP://TINYURL.COM/CO79VKM

WP8

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

Device Nokia Lumia 820 Nokia Lumia 920

Sensor Front Back Front Back Autofocus range Infinity Auto, Macro, Normal, Full,

Hyperfocal, Infinity Infinity Auto, Macro, Normal, Full,

Hyperfocal, Infinity

Preview resolution 640x480 800x448, 640x480 1280x720, 1024x768 1280x720, 1024x768

Capture resolution 640x480 3264x2448, 3552x2000, 2592x1936, 2592x1456, 2048x1536, 640x480

1280x960, 1280x720, 640x480

3264x2448, 3552x2000, 2592x1936, 2592x1456, 2048x1536, 640x480

Exposure compensation (EV)

-12...12 -12...12 -12...12 -12...12

Exposure time (microseconds)

1...33333 1...500000 1...33333 1...500000

Flash mode Off Auto, On, Off Off Auto, On, Off Focus illumination mode Off Auto, On, Off Off Auto, On, Off

ISO 100...800 100...800 100...800 100...800 Manual focus position No Yes, 1000 positions No Yes, 1000 positions

Scene mode Auto, Sport, Night, Backlit Auto, Macro, Sport, Night, Night Portrait, Backlit

Auto, Sport, Night, Backlit Auto, Macro, Sport, Night, Night Portrait, Backlit

White balance preset Cloudy, Daylight, Fluorescent, Tungsten

Cloudy, Daylight, Fluorescent, Tungsten

Cloudy, Daylight, Fluorescent, Tungsten

Cloudy, Daylight, Fluorescent, Tungsten

WP8

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

Windows.Foundation.Size resolution = new Windows.Foundation.Size(640, 480); camera = await PhotoCaptureDevice.OpenAsync(CameraSensorLocation.Back,resolution); viewfinderBrush.SetSource( camera );

Open PhotoCaptureDevice.OpenAsync()

Specify CameraCaptureFrame.DesiredProperties[]

Prepare PhotoCaptureDevice.PrepareCaptureSequenceAsync()

Capture CameraCaptureSequence.StartCaptureAsync()

Process CameraCaptureFrame.CaptureStream

Create PhotoCaptureDevice.CreateCaptureSequence()

CameraCaptureSequence sequence = camera.CreateCaptureSequence(1); sequence.FrameAcquired += sequence_FrameAcquired;

CameraCaptureFrame frame = sequence.Frames[0]; frame.DesiredProperties[KnownCameraPhotoProperties.FlashMode] = FlashState.On;

await camera.PrepareCaptureSequenceAsync(sequence); await sequence.StartCaptureAsync();

WP8

FILTERS

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

KEY TECHNOLOGIES:

DirectX ARM Neon intrinsic

EXAMPLE CODE: http://tinyurl.com/cqc79n4 http://tinyurl.com/cuvosez http://tinyurl.com/bsvoyl9

WP8

HOOKING INTO THE PLATFORM

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

WP8 LENSES

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

WP8

Documentation: http://tinyurl.com/cgcfafd

HOOKING INTO PHOTOS HUB SHARE PICKER RICH MEDIA APPS PHOTO EDIT PICKER

Documentation: http://tinyurl.com/cawyy23

12/5/2012 © 2012 Nokia. All rights reserved. © 2012 Microsoft. All rights reserved.

Thank you!