Photos et autres sensors sur Windows Phone

88
Nokia Internal Use Only

description

La photographie est devenue un scénario clé pour les smartphones. Nous sommes de plus en plus à délaisser nos appareils photo numériques au profit de notre téléphone. Le Nokia Lumia 1020, primé à de nombreuses reprises en est l'illustration. Nous verrons comment tirer partie de toute la puissance de votre smartphone, de la prise de vue au traitement d'image. Dans un deuxième temps, nous verrons comment enrichir une application en exploitant tous les capteurs embarqués : GPS, accéléromètre, bousole, gyroscope... Et pour finir, nous les combinerons tous en créant de la réalité augmentée. Speakers : Nicolas Delabarre (Nokia), Nicolas Calvi (Wygwam)

Transcript of Photos et autres sensors sur Windows Phone

Page 1: Photos et autres sensors sur Windows Phone

Nokia Internal Use Only

Nokia Internal Use OnlyCodedeveloppementCodeDeveloppement

Photos et autres Sensors sur Windows Phone

Nicolas CALVIConsultant Formateur

MVP Hardware Interaction Design amp Development

Wygwam

Nicolas DELABARRERelations techniques deacuteveloppeurs

Nokia Internal Use OnlyCodedeveloppementmstechdays

Depuis votre smartphone sur httpnotesmstechdaysfr

De nombreux lots agrave gagner toute les heures Claviers souris et jeux Microsofthellip

Merci de nous aider agrave ameacuteliorer les Techdays

Donnez votre avis

Nokia Internal Use OnlyCodedeveloppementmstechdays

WINDOWS PHONE

Un teacuteleacutephone plein de ressources

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone

Un OS creacuteer par Microsoft agrave destination des Constructeurs de SmartPhone

Une expeacuterience unique gracircce a Modern UI

Des usages multiplesbull Grand publicbull Entreprise

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone Un concentreacute de technologie

- Cameacutera jusqursquoagrave 41 MP- Flash- GPS- Acceacuteleacuteromegravetre- Baromegravetre (Altimegravetre)- Gyroscope- Wifi Bluetooth 4G- NFC- Magneacutetomegravetre (Boussole)- Capteur de lumiegravere ambiant- Capteur de proximiteacute- hellip

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoallons nous aborder

Les senseurs - Cameacutera gt Videacuteo gt Photo- Acceacuteleacuteromegravetre- Compas- GPS- Gyroscope- Inclinomegravetre- Motion API

On finira par de la Reacutealiteacute Augmenteacutee avec GARTLe capteur NFC ne sera pas traiter dans cette session

Non accessible

- Capteur de proximiteacute- Capteur de luminositeacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR LA CAMEacuteRA

Il sait voir au-delagrave de votre perception

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Le namespaceusing SystemWindowsMedia

Creacuteation du device de capture videacuteoCaptureSource captureSource = new CaptureSource()VideoCaptureDevice device = CaptureDeviceConfigurationGetDefaultVideoCaptureDevice()

On veacuterifie si la capture est possible

if (device = null) On creacutee un Brush pour afficher la videacuteo dans notre UI VideoBrush videoBrush = new VideoBrush() videoBrushSetSource(captureSource) VideoRectFill = videoBrush Rectangle dans notre XAML

On deacutemarre la preacuteview Videacuteo captureSourceStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Ne pas oublier de fermer la camera video

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (captureSource = null) captureSourceStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 2: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementCodeDeveloppement

Photos et autres Sensors sur Windows Phone

Nicolas CALVIConsultant Formateur

MVP Hardware Interaction Design amp Development

Wygwam

Nicolas DELABARRERelations techniques deacuteveloppeurs

Nokia Internal Use OnlyCodedeveloppementmstechdays

Depuis votre smartphone sur httpnotesmstechdaysfr

De nombreux lots agrave gagner toute les heures Claviers souris et jeux Microsofthellip

Merci de nous aider agrave ameacuteliorer les Techdays

Donnez votre avis

Nokia Internal Use OnlyCodedeveloppementmstechdays

WINDOWS PHONE

Un teacuteleacutephone plein de ressources

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone

Un OS creacuteer par Microsoft agrave destination des Constructeurs de SmartPhone

Une expeacuterience unique gracircce a Modern UI

Des usages multiplesbull Grand publicbull Entreprise

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone Un concentreacute de technologie

- Cameacutera jusqursquoagrave 41 MP- Flash- GPS- Acceacuteleacuteromegravetre- Baromegravetre (Altimegravetre)- Gyroscope- Wifi Bluetooth 4G- NFC- Magneacutetomegravetre (Boussole)- Capteur de lumiegravere ambiant- Capteur de proximiteacute- hellip

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoallons nous aborder

Les senseurs - Cameacutera gt Videacuteo gt Photo- Acceacuteleacuteromegravetre- Compas- GPS- Gyroscope- Inclinomegravetre- Motion API

On finira par de la Reacutealiteacute Augmenteacutee avec GARTLe capteur NFC ne sera pas traiter dans cette session

Non accessible

- Capteur de proximiteacute- Capteur de luminositeacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR LA CAMEacuteRA

Il sait voir au-delagrave de votre perception

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Le namespaceusing SystemWindowsMedia

Creacuteation du device de capture videacuteoCaptureSource captureSource = new CaptureSource()VideoCaptureDevice device = CaptureDeviceConfigurationGetDefaultVideoCaptureDevice()

On veacuterifie si la capture est possible

if (device = null) On creacutee un Brush pour afficher la videacuteo dans notre UI VideoBrush videoBrush = new VideoBrush() videoBrushSetSource(captureSource) VideoRectFill = videoBrush Rectangle dans notre XAML

On deacutemarre la preacuteview Videacuteo captureSourceStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Ne pas oublier de fermer la camera video

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (captureSource = null) captureSourceStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 3: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Depuis votre smartphone sur httpnotesmstechdaysfr

De nombreux lots agrave gagner toute les heures Claviers souris et jeux Microsofthellip

Merci de nous aider agrave ameacuteliorer les Techdays

Donnez votre avis

Nokia Internal Use OnlyCodedeveloppementmstechdays

WINDOWS PHONE

Un teacuteleacutephone plein de ressources

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone

Un OS creacuteer par Microsoft agrave destination des Constructeurs de SmartPhone

Une expeacuterience unique gracircce a Modern UI

Des usages multiplesbull Grand publicbull Entreprise

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone Un concentreacute de technologie

- Cameacutera jusqursquoagrave 41 MP- Flash- GPS- Acceacuteleacuteromegravetre- Baromegravetre (Altimegravetre)- Gyroscope- Wifi Bluetooth 4G- NFC- Magneacutetomegravetre (Boussole)- Capteur de lumiegravere ambiant- Capteur de proximiteacute- hellip

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoallons nous aborder

Les senseurs - Cameacutera gt Videacuteo gt Photo- Acceacuteleacuteromegravetre- Compas- GPS- Gyroscope- Inclinomegravetre- Motion API

On finira par de la Reacutealiteacute Augmenteacutee avec GARTLe capteur NFC ne sera pas traiter dans cette session

Non accessible

- Capteur de proximiteacute- Capteur de luminositeacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR LA CAMEacuteRA

Il sait voir au-delagrave de votre perception

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Le namespaceusing SystemWindowsMedia

Creacuteation du device de capture videacuteoCaptureSource captureSource = new CaptureSource()VideoCaptureDevice device = CaptureDeviceConfigurationGetDefaultVideoCaptureDevice()

On veacuterifie si la capture est possible

if (device = null) On creacutee un Brush pour afficher la videacuteo dans notre UI VideoBrush videoBrush = new VideoBrush() videoBrushSetSource(captureSource) VideoRectFill = videoBrush Rectangle dans notre XAML

On deacutemarre la preacuteview Videacuteo captureSourceStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Ne pas oublier de fermer la camera video

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (captureSource = null) captureSourceStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 4: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

WINDOWS PHONE

Un teacuteleacutephone plein de ressources

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone

Un OS creacuteer par Microsoft agrave destination des Constructeurs de SmartPhone

Une expeacuterience unique gracircce a Modern UI

Des usages multiplesbull Grand publicbull Entreprise

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone Un concentreacute de technologie

- Cameacutera jusqursquoagrave 41 MP- Flash- GPS- Acceacuteleacuteromegravetre- Baromegravetre (Altimegravetre)- Gyroscope- Wifi Bluetooth 4G- NFC- Magneacutetomegravetre (Boussole)- Capteur de lumiegravere ambiant- Capteur de proximiteacute- hellip

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoallons nous aborder

Les senseurs - Cameacutera gt Videacuteo gt Photo- Acceacuteleacuteromegravetre- Compas- GPS- Gyroscope- Inclinomegravetre- Motion API

On finira par de la Reacutealiteacute Augmenteacutee avec GARTLe capteur NFC ne sera pas traiter dans cette session

Non accessible

- Capteur de proximiteacute- Capteur de luminositeacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR LA CAMEacuteRA

Il sait voir au-delagrave de votre perception

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Le namespaceusing SystemWindowsMedia

Creacuteation du device de capture videacuteoCaptureSource captureSource = new CaptureSource()VideoCaptureDevice device = CaptureDeviceConfigurationGetDefaultVideoCaptureDevice()

On veacuterifie si la capture est possible

if (device = null) On creacutee un Brush pour afficher la videacuteo dans notre UI VideoBrush videoBrush = new VideoBrush() videoBrushSetSource(captureSource) VideoRectFill = videoBrush Rectangle dans notre XAML

On deacutemarre la preacuteview Videacuteo captureSourceStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Ne pas oublier de fermer la camera video

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (captureSource = null) captureSourceStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 5: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone

Un OS creacuteer par Microsoft agrave destination des Constructeurs de SmartPhone

Une expeacuterience unique gracircce a Modern UI

Des usages multiplesbull Grand publicbull Entreprise

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone Un concentreacute de technologie

- Cameacutera jusqursquoagrave 41 MP- Flash- GPS- Acceacuteleacuteromegravetre- Baromegravetre (Altimegravetre)- Gyroscope- Wifi Bluetooth 4G- NFC- Magneacutetomegravetre (Boussole)- Capteur de lumiegravere ambiant- Capteur de proximiteacute- hellip

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoallons nous aborder

Les senseurs - Cameacutera gt Videacuteo gt Photo- Acceacuteleacuteromegravetre- Compas- GPS- Gyroscope- Inclinomegravetre- Motion API

On finira par de la Reacutealiteacute Augmenteacutee avec GARTLe capteur NFC ne sera pas traiter dans cette session

Non accessible

- Capteur de proximiteacute- Capteur de luminositeacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR LA CAMEacuteRA

Il sait voir au-delagrave de votre perception

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Le namespaceusing SystemWindowsMedia

Creacuteation du device de capture videacuteoCaptureSource captureSource = new CaptureSource()VideoCaptureDevice device = CaptureDeviceConfigurationGetDefaultVideoCaptureDevice()

On veacuterifie si la capture est possible

if (device = null) On creacutee un Brush pour afficher la videacuteo dans notre UI VideoBrush videoBrush = new VideoBrush() videoBrushSetSource(captureSource) VideoRectFill = videoBrush Rectangle dans notre XAML

On deacutemarre la preacuteview Videacuteo captureSourceStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Ne pas oublier de fermer la camera video

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (captureSource = null) captureSourceStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 6: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que Windows Phone Un concentreacute de technologie

- Cameacutera jusqursquoagrave 41 MP- Flash- GPS- Acceacuteleacuteromegravetre- Baromegravetre (Altimegravetre)- Gyroscope- Wifi Bluetooth 4G- NFC- Magneacutetomegravetre (Boussole)- Capteur de lumiegravere ambiant- Capteur de proximiteacute- hellip

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoallons nous aborder

Les senseurs - Cameacutera gt Videacuteo gt Photo- Acceacuteleacuteromegravetre- Compas- GPS- Gyroscope- Inclinomegravetre- Motion API

On finira par de la Reacutealiteacute Augmenteacutee avec GARTLe capteur NFC ne sera pas traiter dans cette session

Non accessible

- Capteur de proximiteacute- Capteur de luminositeacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR LA CAMEacuteRA

Il sait voir au-delagrave de votre perception

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Le namespaceusing SystemWindowsMedia

Creacuteation du device de capture videacuteoCaptureSource captureSource = new CaptureSource()VideoCaptureDevice device = CaptureDeviceConfigurationGetDefaultVideoCaptureDevice()

On veacuterifie si la capture est possible

if (device = null) On creacutee un Brush pour afficher la videacuteo dans notre UI VideoBrush videoBrush = new VideoBrush() videoBrushSetSource(captureSource) VideoRectFill = videoBrush Rectangle dans notre XAML

On deacutemarre la preacuteview Videacuteo captureSourceStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Ne pas oublier de fermer la camera video

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (captureSource = null) captureSourceStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 7: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoallons nous aborder

Les senseurs - Cameacutera gt Videacuteo gt Photo- Acceacuteleacuteromegravetre- Compas- GPS- Gyroscope- Inclinomegravetre- Motion API

On finira par de la Reacutealiteacute Augmenteacutee avec GARTLe capteur NFC ne sera pas traiter dans cette session

Non accessible

- Capteur de proximiteacute- Capteur de luminositeacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR LA CAMEacuteRA

Il sait voir au-delagrave de votre perception

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Le namespaceusing SystemWindowsMedia

Creacuteation du device de capture videacuteoCaptureSource captureSource = new CaptureSource()VideoCaptureDevice device = CaptureDeviceConfigurationGetDefaultVideoCaptureDevice()

On veacuterifie si la capture est possible

if (device = null) On creacutee un Brush pour afficher la videacuteo dans notre UI VideoBrush videoBrush = new VideoBrush() videoBrushSetSource(captureSource) VideoRectFill = videoBrush Rectangle dans notre XAML

On deacutemarre la preacuteview Videacuteo captureSourceStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Ne pas oublier de fermer la camera video

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (captureSource = null) captureSourceStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 8: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR LA CAMEacuteRA

Il sait voir au-delagrave de votre perception

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Le namespaceusing SystemWindowsMedia

Creacuteation du device de capture videacuteoCaptureSource captureSource = new CaptureSource()VideoCaptureDevice device = CaptureDeviceConfigurationGetDefaultVideoCaptureDevice()

On veacuterifie si la capture est possible

if (device = null) On creacutee un Brush pour afficher la videacuteo dans notre UI VideoBrush videoBrush = new VideoBrush() videoBrushSetSource(captureSource) VideoRectFill = videoBrush Rectangle dans notre XAML

On deacutemarre la preacuteview Videacuteo captureSourceStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Ne pas oublier de fermer la camera video

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (captureSource = null) captureSourceStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 9: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Le namespaceusing SystemWindowsMedia

Creacuteation du device de capture videacuteoCaptureSource captureSource = new CaptureSource()VideoCaptureDevice device = CaptureDeviceConfigurationGetDefaultVideoCaptureDevice()

On veacuterifie si la capture est possible

if (device = null) On creacutee un Brush pour afficher la videacuteo dans notre UI VideoBrush videoBrush = new VideoBrush() videoBrushSetSource(captureSource) VideoRectFill = videoBrush Rectangle dans notre XAML

On deacutemarre la preacuteview Videacuteo captureSourceStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Ne pas oublier de fermer la camera video

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (captureSource = null) captureSourceStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 10: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment afficher le flux videacuteo Ne pas oublier de fermer la camera video

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (captureSource = null) captureSourceStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 11: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On veacuterifie si la cameacutera est disponibleif ((PhotoCameraIsCameraTypeSupported(CameraTypePrimary) == true) || (PhotoCameraIsCameraTypeSupported(CameraTypeFrontFacing) == true)) PhotoCamera photoCamera

Initialise la cameacutera en fonction des capaciteacutees trouveacutees if (PhotoCameraIsCameraTypeSupported(CameraTypePrimary)) photoCamera = new PhotoCamera(CameraTypePrimary) else photoCamera = new PhotoCamera(CameraTypeFrontFacing)

On se branche sur les eacuteveacutenements photoCameraInitialized += OnPhotoCameraInitialized photoCameraCaptureCompleted += OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable += OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable += OnPhotoCameraCaptureThumbnailAvailable

Creacuteation dun Brush pour afficher le buffer dans notre UI VideoBrush photoBrush = new VideoBrush() photoBrushSetSource(photoCamera) Affectation du Brush a notre zone de rendu PhotoRectFill = photoBrush Rectangle dans notre XAML

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 12: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo

Deacuteclenche la prise de photophotoCameraCaptureImage()

OnPhotoCameraCaptureCompleted

OnPhotoCameraCaptureImageAvailable

OnPhotoCameraCaptureThumbnailAvailable

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 13: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo On sauvegarde la photo dans la meacutedia MediaLibrary librarylibrary = new MediaLibrary()librarySavePictureToCameraRoll(MonFichierjpg eImageStream)

On se repositionne au deacutebut du flux de limageeImageStreamSeek(0 SeekOriginBegin)

Enregistrement de la photo en JPEG dans le reacutepertoire localusing (IsolatedStorageFile isStore = IsolatedStorageFileGetUserStoreForApplication()) using (IsolatedStorageFileStream targetStream = isStoreOpenFile(fileName FileModeCreate FileAccessWrite)) Initialisation du buffer (4ko) byte[] readBuffer = new byte[4096] int bytesRead = -1

On copie limage dans le reacutepertoire local while ((bytesRead = eImageStreamRead(readBuffer 0 readBufferLength)) gt 0) targetStreamWrite(readBuffer 0 bytesRead)

On ferme le fichiereImageStreamClose()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 14: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment prendre une photo Ne pas oublier de fermer la camera photo

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (photoCamera = null) photoCameraInitialized -= OnPhotoCameraInitialized photoCameraCaptureCompleted -= OnPhotoCameraCaptureCompleted photoCameraCaptureImageAvailable -= OnPhotoCameraCaptureImageAvailable photoCameraCaptureThumbnailAvailable -= OnPhotoCameraCaptureThumbnailAvailable

photoCameraDispose()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 15: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Prise de photo haute reacutesolution

Lumia 10207712 x 4352 (169)7136 x 5360 (43)

Lumia 15205376 x 3024 (169)4992 x 3744 (43)

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 16: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

NOKIA IMAGING SDK 10

Allez plus loin avec ses photos

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 17: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Librairie native Windows Phone 8 accessible depuis des projets WP8 C VB et C++

bull Inclus plus de 50 filtres de traitement drsquoimages et effets visuels parameacutetrables

bull Ne neacutecessite aucune connaissance particuliegravere en traitement algorithmique drsquoimages

bull Deacutecodage JPEG partiel ndash baseacutee sur la technologie RAJPEG afin drsquoacceacuteder aux donneacutees sans deacutecoder toute lrsquoimage JPEG bull Preacutevisualisation rapide bull Application drsquoeffets tels que la rotation ou le

cropping drsquoimages haute reacutesolution

Qursquoest-ce que le SDK Nokia Imaging

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 18: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (13)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 19: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (23)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 20: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Liste de filtres et effets (33)

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 21: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Enchaicircnement de filtres

Image originale

+Milky+Flip

+Crop

+Lomo

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 22: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Architecture geacuteneacuteralebull Cette librairie est architectureacutee en 3

blocs bull Image sources (eg bitmaps

streams files)bull Effect (eg 50+ filtres)bull Renderers (outputs bitmaps or files)

bull En combinant ces blocs on va creacuteer un tunnel de traitement drsquoimage ( ou ldquorendering pipelinerdquo)

bull Une fois le tunnel creacuteeacute il est possible de modifier les paramegravetres de filtres ou leur seacutequencement

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 23: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Producteur Consommateur

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 24: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment appliquer un filtre agrave une photo Creacuteation dun nokia stream agrave partir dun IO Stream

using(var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using (var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect _writeableBitmapTarget))

Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 25: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Et plusieurs filtres Creacuteation dun nokia stream agrave partir dun IO Stream

using( var source = new StreamImageSource(eChosenPhoto))

Creacuteation dun effet initial agrave partir de la source stream nokia

using( var effect = new FilterEffect(source))

Instanciation dun render de type WriteableBitmap

using( var render = new WriteableBitmapRenderer(effect

_writeableBitmapTarget)) Creacuteation de la liste des filtres

var filters = new ListltIFiltergt() filtersAdd(new MagicPenFilter()) filtersAdd(new RotationFilter(15)) Affectation de la liste de filtres agrave notre objet effet

effectFilters = filters

Exeacutecution du rendu

await renderRenderAsync()

Force le repaint de limage reacutesultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 26: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtre

Les paramegravetres peuvent ecirctre changeacutes sans reconstruire le tunnel de traitement

bull Neacuteanmoins il faut garder agrave lrsquoesprit bull Que le rendu est asynchrone les paramegravetres ne peuvent pas

ecirctre changeacutes en coursbull Attention avec certains controcircles UI (eg sliders) qui peuvent

geacuteneacuterer des eacuteveacutenements nrsquoimporte quand

bull Astuce utiliser une file drsquoattente drsquoeacuteveacutenements de type QueueltActiongt

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 27: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

UI (Slider)Imaging

SDK

ValueChanged event

ValueChanged event

Rendering a new preview

Rendering a new preview

ValueChanged event

Modifier les paramegravetres de filtre

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 28: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Modifier les paramegravetres de filtreDeacutefinir une queue drsquoattente

QueueltSystemActiongt _toDo = new QueueltSystemActiongt()

Quand la ressource est occupeacutee empiler lrsquoaction dans la queue drsquoattente

_toDoEnqueue( () =gt _warpFilterLevel = newValue )

Quand la ressource est dispo traitement des actions en attente while (_toDoCount gt 0)

Action action = _toDoDequeue() action() await _rendererRenderAsync()

Lambda expression directement

mise en queue

Exeacutecution des lambda expression

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 29: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Image SourceType de source Class ImageSource

Name

Stream SystemIOStream StreamImageSource

Image Bitmap WindowsMediaImagingWriteableBitmap

NokiaGraphicsImagingBitmap

BitmapImageSource

Windows Buffer

WindowsStorageStreamsIBuffer BufferImageSource

Camera WindowsPhoneMediaCaptureICameraCaptureDevice

CameraPreviewImageSource

Flat Color WindowsUiColor ColorImageSource

File WindowsStorageIStorageFile StorageFileImageSource

Random Access Stream

WindowsStorageStreamsIRandomAccessStream

RandomAccessStreamImageSource

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 30: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Renderer

Image Source

Filter Effects

MagicPen FilterFlip Filter

Rotation Filter

Renderer

Type de Destination

Class ImageSource Name

Imaging SDK Bitmap

NokiaGraphicsImagingBitmap

BitmapRenderer

Writeable Bitmaps(XAML Image )

WriteableBitmap WriteableBitmapRenderer

JPEG WindowsStorageStreamsIBuffer

JpegRenderer

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 31: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Impleacutementation de filtre personnaliseacute Creacuteation dun effet personnaliseacute

public class MyCustomFilter CustomEffectBase public MyCustomFilter(IImageProvider source) base(source)

protected override void OnProcess(PixelRegion sourcePixelRegion PixelRegion targetPixelRegion)

sourcePixelRegionForEachRow((index width pos) =gt for (int i = 0 i lt width ++i ++index) WindowsUIColor c = ToColor(sourcePixelRegionImagePixels[index]) cR = (byte)MathMin(255 cR 2) cG = (byte)MathMin(255 cG 2) cB = (byte)MathMin(255 cB 2) targetPixelRegionImagePixels[index] = FromColor(c) )

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 32: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

bull Faciliteacute drsquoutilisationbull Faible empreinte meacutemoire

APIs pour creacuteer des images sources de type gradients

LinearGradient

RadialGradient

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 33: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Creacuteation drsquoimage source gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun gradient de couleur de type radial

var rad = new RadialGradient(new WindowsFoundationPoint(05 05) new EllipseRadius(03 03))radStops = new GradientStop[]

new GradientStop() Color = WindowsUIColorFromArgb(255 255 0 0) Offset = 0 new GradientStop() Color = WindowsUIColorFromArgb(255 0 255 0) Offset = 1

Creacuteation dune image source de type gradient agrave partir du gradient

using (var grad = new GradientImageSource( new WindowsFoundationSize(imageTargetWidth imageTargetHeight) rad)) Instantiation dun render de type WriteableBitmap initialiseacute avec notre gradient source et le writeable bitmap de sortie

var render = new WriteableBitmapRenderer(grad _writeableBitmapTarget) Exeacutecution du rendu

await renderRenderAsync()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 34: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend modes

Blend mode Color Burn

Blend mode Color

Blend mode Add

1egravere image 2nde image

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 35: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Blend drsquoune photo avec un gradient Affectation de la source de notre Image XAML avec un writeable bitmapimageTargetSource = _writeableBitmapTarget

Creacuteation dun nokia stream agrave partir dun IO Streamusing (var backgroundSource = new StreamImageSource(eChosenPhoto))

Creacuteation dune image source de type gradient agrave partir du gradientusing(var foregroundSource = new GradientImageSource( ))

Creacuteation dun filtre deffet sourceacute avec limage choisie par lutilisateurusing(var filterEffect = new FilterEffect(backgroundSource))

Creacuteation dun filtre de blending sourceacute avec limage source gradientusing(var blendFilter = new BlendFilter(foregroundSource))

Instantiation dun render de type WriteableBitmap initialiseacute avec notre filtre deffet et le bitmap de sortieusing(var renderer = new WriteableBitmapRenderer(filterEffect _writeableBitmapTarget)) Configuration de notre filtre deffet avec un seul effet notre effet blend blendFilterBlendFunction = BlendFunctionColor filterEffectFilters = new IFilter[] blendFilter

Exeacutecution du rendu await rendererRenderAsync()

Force le repaint de limage resultante _writeableBitmapTargetInvalidate()

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 36: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

ChromaKey + Blend

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 37: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour aller plus loinPoint drsquoentreacutee des ressources techniques relative au SDK Imaging httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdkhtml

Projets drsquoexemples baseacutes sur le SDK Imaging (avec code source) httpdevelopernokiacomresourceslibraryLumianokia-imaging-sdksample-projectshtml

Forum de discussion deacutedieacute au SDK Imaging httpdevelopernokiacomcommunitydiscussion

Articles Wiki httpdevelopernokiacomcommunitywikiPortalWindows_Phone_Multimedia

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 38: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR ACCELEROMETRE

Une bonne raison de bouger utile

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 39: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un acceacuteleacuteromegravetre est un capteur qui fixeacute agrave un mobile ou tout autre objet permet de mesurer lrsquoacceacuteleacuteration lineacuteaire de ce dernier

On parle encore dacceacuteleacuteromegravetre mecircme sil sagit en fait de 3 acceacuteleacuteromegravetres qui calculent les 3 acceacuteleacuterations lineacuteaires selon 3 axes orthogonauxSource Wikipeacutedia httpfrwikipediaorgwikiAccC3A9lC3A9romC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 40: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (AccelerometerIsSupported) return

Comment lrsquoinstancieraccelerometer = new Accelerometer()accelerometerTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationaccelerometerCurrentValueChanged += OnAccelerometerCurrentValueChanged

Comment le deacutemarreraccelerometerStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 41: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnAccelerometerCurrentValueChanged(object sender SensorReadingEventArgsltAccelerometerReadinggt args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtAccelerationXText = readingAccelerationXToString() TxtAccelerationYText = readingAccelerationYToString() TxtAccelerationZText = readingAccelerationZToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 42: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (accelerometer = null) accelerometerStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 43: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancieraccelerometer = AccelerometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (accelerometer = NULL) return

Comment reacutecupeacuterer lrsquoinformation

accelerometerReadingChanged += OnAccelerometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 44: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnAccelerometerReadingChanged(Accelerometer sender AccelerometerReadingChangedEventArgs args) AccelerometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtAccelerationXText = readingAccelerationXToString(000) TxtAccelerationYText = readingAccelerationYToString(000) TxtAccelerationZText = readingAccelerationZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 45: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR COMPAS

Pour que tout cela est un sens

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 46: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

le compas magneacutetique dont le principe de fonctionnement est comme une boussole lorientation dune aiguille aimanteacutee dans le champ du magneacutetisme terrestre

Source Wikipeacutedia httpfrwikipediaorgwikiCompas_(navigation)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 47: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (CompassIsSupported) return

Comment lrsquoinstanciercompass = new Compass()compassTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationcompassCurrentValueChanged += OnCompassCurrentValueChangedcompassCalibrate += OnCompassCalibrate

Comment le deacutemarrercompassStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 48: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCurrentValueChanged(object sender SensorReadingEventArgsltCompassReadinggt args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtMagneticHeadingText = readingMagneticHeadingToString() TxtTrueHeadingText = readingTrueHeadingToString() TxtAccuracyText = readingHeadingAccuracyToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 49: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnCompassCalibrate(object sender CalibrationEventArgs args) Mettre votre code ici Le compas a besoin drsquoecirctre calibreacute

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 50: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Pour calibrer le compas si la proprieacuteteacute laquo Accuracy raquo est supeacuterieure agrave 15 il faut faire des laquo 8 raquo avec le teacuteleacutephone

Ceci peut-ecirctre geacuterer dans lrsquointerface en affichant un texte drsquoaide invitant lrsquoutilisateur a faire les laquo 8 raquo

Degraves que la valeur descend en dessous de 15 on peut notifier lrsquoutilisateur que le compas est calibreacute

API speacutecifique Windows Phone 8

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 51: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (compass = null) compassStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 52: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciercompass = CompassGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (compass = NULL) return

Comment reacutecupeacuterer lrsquoinformation

compassReadingChanged += OnCompassReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 53: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnCompassReadingChanged(Compass sender CompassReadingChangedEventArgs args) CompassReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt CompassTimeText = readingTimestampToString() CompassMagneticHeadingText = readingHeadingMagneticNorthToString() CompassTrueHeadingText = readingHeadingTrueNorthValueToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 54: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GPS

Si vous nrsquoavez pas le sens de lrsquoorientation mieux vaut le consulter

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 55: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Le Global Positioning System (GPS) ndash que lon peut traduire en franccedilais par laquo systegraveme de localisation mondial raquo ndash est un systegraveme de geacuteolocalisation fonctionnant au niveau mondial

Source Wikipeacutedia httpfrwikipediaorgwikiGlobal_Positioning_System

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 56: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing SystemDeviceLocation

Comment lrsquoinstanciergps = new GeoCoordinateWatcher(GeoPositionAccuracyHigh) Ou DefaultgpsMovementThreshold = 0

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeoCoordinateWatcherPositionChangedgpsStatusChanged += OnGeoCoordinateWatcherStatusChanged

Comment le deacutemarrergpsStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 57: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherStatusChanged(object sender GeoPositionStatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

GeoPositionStatusDisabled Initializing NoData Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 58: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeoCoordinateWatcherPositionChanged(object sender GeoPositionChangedEventArgsltGeoCoordinategt args)

thisDispatcherBeginInvoke(() =gt GPSTimeText = ePositionTimestampToString() GPSLatitudeText = ePositionLocationLatitudeToString() GPSLongitudeText = ePositionLocationLongitudeToString() GPSAltitudeText = ePositionLocationAltitudeToString() GPSHAccuracyText = ePositionLocationHorizontalAccuracyToString() GPSVAccuracyText = ePositionLocationVerticalAccuracyToString() GPSCourseText = ePositionLocationCourseToString() GPSSpeedText = ePositionLocationSpeedToString() GPSUnknownText = ePositionLocationIsUnknownToString() )

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 59: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gps = null) gpsStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 60: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesGeolocation

Comment lrsquoinstanciergps = new Geolocator()

gpsDesiredAccuracy = PositionAccuracyHigh Ou DefaultgpsDesiredAccuracyInMeters = 10 En dessous de 10m ce nrsquoest pas possiblegpsMovementThreshold = 0gpsReportInterval = 1000 Le GPS a un taux de rafraichissement drsquo1Hz

Comment reacutecupeacuterer lrsquoinformationgpsPositionChanged += OnGeolocatorPositionChangedgpsStatusChanged += OnGeolocatorStatusChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 61: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorStatusChanged(Geolocator sender StatusChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSManualStatusText = eStatusToString() )

Les valeurs de Status

PositionStatusDisabled Initializing NoData NotAvailable NotInitialized Ready

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 62: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGeolocatorPositionChanged (Geolocator sender PositionChangedEventArgs args) thisDispatcherBeginInvoke(() =gt GPSTimeText = argsPositionCoordinateTimestampToString() GPSLatitudeText = argsPositionCoordinateLatitudeToString() GPSLongitudeText = argsPositionCoordinateLongitudeToString() GPSAltitudeText = argsPositionCoordinateAltitudeToString() GPSAltitudeAccuracyText = argsPositionCoordinateAltitudeAccuracyToString() GPSAccuracyText = argsPositionCoordinateAccuracyToString() GPSSpeedText = argsPositionCoordinateSpeedToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 63: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR GYROSCOPE

Il ne vous fera pas tourner en bourrique celui lagrave

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 64: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un gyroscope (du grec laquo qui observe la rotation raquo) est un appareil qui exploite le principe de la conservation du moment angulaire en physique (ou encore stabiliteacute gyroscopique ou effet gyroscopique)

Cette loi fondamentale de la meacutecanique veut quen labsence de couple appliqueacute agrave un solide en rotation celui-ci conserve son axe de rotation invariableSource Wikipeacutedia httpfrwikipediaorgwikiGyroscope

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 65: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8 Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (GyroscopeIsSupported) return

Comment lrsquoinstanciergyroscope = new Gyroscope()gyroscopeTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationgyroscopeCurrentValueChanged += OnGyroscopeCurrentValueChanged

Comment le deacutemarrergyroscopeStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 66: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltGyroscopeReadinggt args) GyroscopeReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString() TxtRotationXText = readingRotationRateXToString() TxtRotationYText = readingRotationRateYToString() TxtRotationZText = readingRotationRateZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 67: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API speacutecifique Windows Phone 8Ne pas oublier de fermer le senseur

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) if (gyroscope = null) gyroscopeStop()

baseOnNavigatingFrom(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 68: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstanciergyroscope = GyrometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (gyroscope = NULL) return

Comment reacutecupeacuterer lrsquoinformation

gyroscopeReadingChanged += OnGyroscopeReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 69: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnGyroscopeReadingChanged (Gyrometer sender GyrometerReadingChangedEventArgs args) GyrometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtRotationXText = readingAngularVelocityXToString(000) TxtRotationYText = readingAngularVelocityYToString(000) TxtRotationZText = readingAngularVelocityZToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 70: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

SENSEUR INCLINOMEgraveTRE

Tel le bambou il sait plier

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 71: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Un inclinomegravetre (ou clinomegravetre) est un capteur servant agrave mesurer des angles par rapport agrave la ligne dhorizon (ou horizontale)

Lagrave ougrave le niveau agrave bulle (ou niveau) permet de deacutetecter preacuteciseacutement ougrave se situe lhorizontale linclinomegravetre deacutetermine en plus langle dinclinaison par rapport agrave cette horizontale

Source Wikipeacutedia httpfrwikipediaorgwikiInclinomC3A8tre

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 72: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8 Le namespaceusing WindowsDevicesSensors

Comment lrsquoinstancierinclinometer = InclinometerGetDefault()

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (inclinometer= NULL) return

Comment reacutecupeacuterer lrsquoinformation

inclinometerReadingChanged += OnInclinometerReadingChanged

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 73: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

API partageacutees avec Windows 8private void OnInclinometerReadingChanged (Inclinometer sender InclinometerReadingChangedEventArgs args) InclinometerReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingPitchDegreesToString(000) TxtRollText = readingRollDegreesToString(000) TxtYawText = readingYawDegreesToString(000)

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 74: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

MOTION API

Avoir tous ses sens en eacuteveils

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 75: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que crsquoest

Vous pouvez utiliser la laquo Motion API raquo pour creacuteer des applications Windows Phone qui utilisent lorientation et le mouvement de lappareil dans lespace comme un meacutecanisme dentreacutee

La plate-forme Windows Phone inclut des APIs pour obtenir des donneacutees brutes du capteur de la boussole de lappareil gyroscope acceacuteleacuteromegravetre et des capteurs

Cependant la laquo Motion API raquo gegravere le calcul complexe neacutecessaire pour combiner les donneacutees de ces capteurs et produire des valeurs facile agrave utiliser pour lattitude et le mouvement de lappareil

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 76: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche Le namespaceusing MicrosoftDevicesSensors

Comment savoir si le teacuteleacutephone supporte cette fonctionnaliteacuteif (MotionIsSupported) return

Comment lrsquoinstanciermotion = new Motion()motionTimeBetweenUpdates = TimeSpanFromMilliseconds(20)

Comment reacutecupeacuterer lrsquoinformationmotionCurrentValueChanged += OnMotionCurrentValueChanged

Comment le deacutemarrermotionStart()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 77: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche private void OnGyroscopeCurrentValueChanged(object sender SensorReadingEventArgsltMotionReadinggt args) MotionReading reading = argsSensorReading

thisDispatcherBeginInvoke(() =gt TxtTimestampText = readingTimestampToString()

TxtPitchText = readingAttitudePitchToString() En radian TxtRollText = readingAttitudeRollToString() En radian TxtYawText = readingAttitudeYawToString() En radian

TxtAccellerationXText = readingDeviceAccelerationXToString() TxtAccellerationYText = readingDeviceAccelerationYToString() TxtAccellerationZText = readingDeviceAccelerationZToString()

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 78: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Connaicirctre lrsquoattitude

La laquo Motion API raquo permet de connaicirctre lrsquoorientation du teacuteleacutephone dans un espace 3D Dans les informations retourneacutees on peut reacutecupeacuterer le Quaternion et la matrice de rotation de cette attitude

MotionReading reading = argsSensorReading

Reacutecupeacuteration du QuaternionreadingQuaternion

Reacutecupeacuteration de la matrice de rotationreadingRotationMatrix

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 79: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

REALITE AUGMENTEE GART

Regarder le monde sous un nouveau jour nrsquoest-ce pas Wayne

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 80: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Qursquoest-ce que GART Un SDK Open Source deacutevelopper par un employeacute de Microsoft

Permet de faire de la reacutealiteacute augmenteacutee Geacuteo localiseacutee

Compatible - Windows Phone 7 et 8- Windows 8 et 81

Disponible agrave cette adresse httpgartcodeplexcom

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 81: Photos et autres sensors sur Windows Phone

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

NOKIA JOB HUB

Application Pilote Windows Phone reacutealiseacutee avec GART

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 82: Photos et autres sensors sur Windows Phone

Nokia Internal Use Only

Videacuteo

Codedeveloppementmstechdays

>

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 83: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche ltphonePhoneApplicationPage xmlnsgart=clr-namespaceGARTControlsassembly=GARTWP8gtltGridgt ltgartARDisplay xName=ARDisplay AttitudeRefreshRate=50 MovementThreshold=10gt ltgartVideoPreview gt ltgartWorldView FarClippingPlane=3000 MaxItemScale=10 MinItemScale=01 NearClippingPlane=10gt ltgartWorldViewItemTemplategt ltDataTemplategt ltBorder Background=White BorderBrush=Green BorderThickness=1 Padding=5gt ltTextBlock FontSize=20 Foreground=Black Text=Binding Content gt ltBordergt ltDataTemplategt ltgartWorldViewItemTemplategt ltgartWorldViewgt ltgartARDisplaygtltGridgt

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 84: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche On creacutee une liste de point a afficheritems = new ObservableCollectionltARItemgt()

Creacuteation drsquoun eacuteleacutement a afficher Mettre ici des eacuteleacutements valide en coordonneacutee pour les voir apparaitre Pour trouver des coordonneacutees allez sur Bing MapsARItem point = new ARItem()pointContent = Un objet a afficherpointGeoLocation = new SystemDeviceLocationGeoCoordinate(48821229 2254397 0)

itemsAdd(point)

On affecte la source

thisARDisplayARItems = items

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 85: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Comment ccedila marche protected override void OnNavigatedFrom(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStopServices() baseOnNavigatedFrom(e)

protected override void OnNavigatedTo(SystemWindowsNavigationNavigationEventArgs e) thisARDisplayStartServices() baseOnNavigatedTo(e)

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 86: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

DES QUESTIONS

Nrsquoheacutesitez pas on sera ravi de vous reacutepondre

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 87: Photos et autres sensors sur Windows Phone

Nokia Internal Use OnlyCodedeveloppementmstechdays

Restez en contact

Nicolas Calvi

Blog gt blognicolascalvicomTwitter gt nicolascalviPage Facebook gt Black Blog

Nicolas Delabarre

Blog gt wwwnokiadevblogfrTwitter gt NokiaDev_FrancePage Facebook gt NokiaDevFranceCode source httpsdrvms1coyrnH

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88
Page 88: Photos et autres sensors sur Windows Phone

Nokia Internal Use Only

copy 2014 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION

Digital is business

  • Slide 1
  • Photos et autres Sensors sur Windows Phone
  • Donnez votre avis
  • Windows phone
  • Qursquoest-ce que Windows Phone
  • Qursquoest-ce que Windows Phone (2)
  • Qursquoallons nous aborder
  • Senseur la cameacutera
  • Comment afficher le flux videacuteo
  • Comment afficher le flux videacuteo (2)
  • Comment prendre une photo
  • Comment prendre une photo (2)
  • Comment prendre une photo (3)
  • Comment prendre une photo (4)
  • Prise de photo haute reacutesolution
  • NOKIA IMAGING SDK 10
  • Qursquoest-ce que le SDK Nokia Imaging
  • Liste de filtres et effets (13)
  • Liste de filtres et effets (23)
  • Liste de filtres et effets (33)
  • Enchaicircnement de filtres
  • Architecture geacuteneacuterale
  • Producteur Consommateur
  • Comment appliquer un filtre agrave une photo
  • Et plusieurs filtres
  • Modifier les paramegravetres de filtre
  • Modifier les paramegravetres de filtre (2)
  • Modifier les paramegravetres de filtre (3)
  • Image Source
  • Renderer
  • Impleacutementation de filtre personnaliseacute
  • APIs pour creacuteer des images sources de type gradients
  • Creacuteation drsquoimage source gradient
  • Blend modes
  • Blend drsquoune photo avec un gradient
  • ChromaKey + Blend
  • Pour aller plus loin
  • Senseur ACCELEROMETRE
  • Qursquoest-ce que crsquoest
  • API speacutecifique Windows Phone 8
  • API speacutecifique Windows Phone 8 (2)
  • API speacutecifique Windows Phone 8 (3)
  • API partageacutees avec Windows 8
  • API partageacutees avec Windows 8 (2)
  • Senseur COMPAS
  • Qursquoest-ce que crsquoest (2)
  • API speacutecifique Windows Phone 8 (4)
  • API speacutecifique Windows Phone 8 (5)
  • API speacutecifique Windows Phone 8 (6)
  • API speacutecifique Windows Phone 8 (7)
  • API speacutecifique Windows Phone 8 (8)
  • API partageacutees avec Windows 8 (3)
  • API partageacutees avec Windows 8 (4)
  • Senseur GPS
  • Qursquoest-ce que crsquoest (3)
  • API speacutecifique Windows Phone 8 (9)
  • API speacutecifique Windows Phone 8 (10)
  • API speacutecifique Windows Phone 8 (11)
  • API speacutecifique Windows Phone 8 (12)
  • API partageacutees avec Windows 8 (5)
  • API speacutecifique Windows Phone 8 (13)
  • API speacutecifique Windows Phone 8 (14)
  • Senseur Gyroscope
  • Qursquoest-ce que crsquoest (4)
  • API speacutecifique Windows Phone 8 (15)
  • API speacutecifique Windows Phone 8 (16)
  • API speacutecifique Windows Phone 8 (17)
  • API partageacutees avec Windows 8 (6)
  • API partageacutees avec Windows 8 (7)
  • Senseur Inclinomegravetre
  • Qursquoest-ce que crsquoest (5)
  • API partageacutees avec Windows 8 (8)
  • API partageacutees avec Windows 8 (9)
  • MOTION API
  • Qursquoest-ce que crsquoest (6)
  • Comment ccedila marche
  • Comment ccedila marche (2)
  • Connaicirctre lrsquoattitude
  • REALITE AUGMENTEE GART
  • Qursquoest-ce que GART
  • NOKIA Job hub
  • Slide 82
  • Comment ccedila marche (3)
  • Comment ccedila marche (4)
  • Comment ccedila marche (5)
  • Des Questions
  • Restez en contact
  • Slide 88