Mais conteúdo relacionado Semelhante a LUMIA APP LABS: CREATE STUNNING IMAGING APPS FOR LUMIA PHONES (20) Mais de Microsoft Mobile Developer (20) LUMIA APP LABS: CREATE STUNNING IMAGING APPS FOR LUMIA PHONES1. LUMIA APP LABS #4
CREATE STUNNING
IMAGING APPS
Berthier Lemieux
Technology Wizard
2. TYPICAL CAMERA USE CASES.
WP7.5 WP8
IMAGE PICKER X X
AUGMENTED REALITY VIEWFINDER X X
PRO-CAMERA X
FILTERS X
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
3. IMAGE PICKER
KEY APIS:
Microsoft.Phone.Tasks.PhotoChooserTask
Microsoft.Phone.Tasks.CameraCaptureTask
Example code:
http://tinyurl.com/cqlezbn
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
4. IMAGE PICKER
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;
...
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
5. AR VIEWFINDER
KEY API:
Microsoft.Devices.PhotoCamera
Microsoft.Devices.Sensors.Motion
System.Windows.Media.VideoBrush
Example code:
http://tinyurl.com/c3sdyqa
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
6. DISPLAY THE CAMERA FRAMES
<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);
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
7. YAW
ROLL
PITCH
See also Petzold:
http://tinyurl.com/cgydz3u
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
8. AR VIEWFINDER
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
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
9. PRO-CAMERA
WP8
KEY API:
Windows.Phone.Media.Capture.PhotoCaptureDevice
Windows.Phone.Media.Capture.CameraCaptureSequence
Example code:
HTTP://TINYURL.COM/CO79VKM
10. Device Nokia Lumia 820 Nokia Lumia 920 WP8
Sensor Front Back Front Back
Autofocus range Infinity Auto, Macro, Normal, Full, Infinity Auto, Macro, Normal, Full,
Hyperfocal, Infinity Hyperfocal, Infinity
Preview resolution 640x480 800x448, 640x480 1280x720, 1024x768 1280x720, 1024x768
Capture resolution 640x480 3264x2448, 3552x2000, 1280x960, 1280x720, 3264x2448, 3552x2000,
2592x1936, 2592x1456, 640x480 2592x1936, 2592x1456,
2048x1536, 640x480 2048x1536, 640x480
Exposure compensation -12...12 -12...12 -12...12 -12...12
(EV)
Exposure time 1...33333 1...500000 1...33333 1...500000
(microseconds)
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, Auto, Sport, Night, Backlit Auto, Macro, Sport,
Night, Night Portrait, Night, Night Portrait,
Backlit Backlit
White balance preset Cloudy, Daylight, Cloudy, Daylight, Cloudy, Daylight, Cloudy, Daylight,
Fluorescent, Tungsten Fluorescent, Tungsten Fluorescent, Tungsten Fluorescent, Tungsten
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
11. WP8
Windows.Foundation.Size resolution = new Windows.Foundation.Size(640, 480);
camera = await PhotoCaptureDevice.OpenAsync(CameraSensorLocation.Back,resolution);
viewfinderBrush.SetSource( camera );
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();
Open Prepare
PhotoCaptureDevice.OpenAsync() PhotoCaptureDevice.PrepareCaptureSequenceAsync()
Create Capture
PhotoCaptureDevice.CreateCaptureSequence() CameraCaptureSequence.StartCaptureAsync()
Specify Process
CameraCaptureFrame.DesiredProperties[] CameraCaptureFrame.CaptureStream
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
12. WP8
FILTERS
KEY TECHNOLOGIES:
DirectX
ARM Neon intrinsic
EXAMPLE CODE:
http://tinyurl.com/cqc79n4
http://tinyurl.com/cuvosez
http://tinyurl.com/bsvoyl9
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
14. WP8 LENSES
WP8
Documentation:
http://tinyurl.com/cgcfafd
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.
15. HOOKING INTO PHOTOS HUB
SHARE PICKER
RICH MEDIA APPS
PHOTO EDIT PICKER
Documentation:
http://tinyurl.com/cawyy23
16. Thank you!
© 2012 Nokia. All rights reserved. 12/5/2012
© 2012 Microsoft. All rights reserved.