SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
WORKING WITH
HIGH-RESOLUTION
IMAGES
LUMIA APP LABS #14
Berthier Lemieux
Technology Wizard
Sensor size 1/1.5”
Pixel size 1.1 micron
Optical Image Stabilization
Total sensor : 7712x5360 = 41.3MP
16:9 mode : 7712x4352 = 33.6 MP
4:3 mode : 7136x5360 = 38.2 MP
NOKIA LUMIA 1020 CAMERA SENSOR
• By default, the PhotoCaptureDevice doesn’t
expose the 34 or 38 megapixels resolutions.
• Applications needs to specifically be aware of
that resolution.
5 MP OR HIGH RES?
Without any changes, your
app will capture 5 MP images
and they will look awesome!
ZOOMING
BE NICE TO
YOUR
NEIGHBOURS!
High res images requires special attention
and may break other applications.
Don’t save full resolution images to the
camera roll.
The camera application saves
both the full resolution and
an oversampled image
simultaneously.
DUAL CAPTURE IN NOKIA CAMERA PRO
Use the data contained
in the full resolution
image to create the
best 5MP image.
OVERSAMPLING
7136
5360
2592
1936
38.2 MP 5 MP
Standard 5 MP Oversampled 5 MP
• The high resolution image is saved locally to the application.
• The high resolution image file, the ”original”, will never be modified.
That file can’t be accessed through the PhotoPickerTask.
• An oversampled (5 MP) image is saved to the camera roll.
• Whenever they desire, the user can reframe the image; change where
and how deep they want to zoom in on the image. A new oversampled
(5 MP) image is saved to the camera roll, overwriting the existing one.
• It is highly recommended to follow a similar design pattern in your
application.
DUAL CAPTURE IN NOKIA CAMERA PRO
Download the code from developer.nokia.com
SAMPLE APP: PHOTO INSPECTOR
1. Capture a high resolution image.
2. Save it to your local storage.
3. Do your magic.
4. Scale down the resulting image to 5MP.
5. Save the 5MP image to the camera roll.
6. Implement the Rich Media extension.
7. Keep application local storage clean.
STEPS
captureResolution = PhotoCaptureDevice.GetAvailableCaptureResolutions(SENSOR_LOCATION).First();
var deviceName = Microsoft.Phone.Info.DeviceStatus.DeviceName;
if (deviceName.Contains("RM-875") || deviceName.Contains("RM-876") || deviceName.Contains("RM-877"))
{
// We now knows that the application runs on a Lumia 1020
captureResolution = new Windows.Foundation.Size(7712, 4352); // 16:9 ratio
//captureResolution = new Windows.Foundation.Size(7136, 5360); // 4:3 ratio
}
_device = await PhotoCaptureDevice.OpenAsync(SENSOR_LOCATION, captureResolution);
STEP 1 : CAPTURE A HIGH RESOLUTION IMAGE
using (var store = IsolatedStorageFile.GetUserStoreForApplication())
{
var localPath = @"LocalImages";
if (!store.DirectoryExists(localPath))
{
store.CreateDirectory(localPath);
}
using (var file = store.CreateFile(localPath + @"" + filenameBase + @".jpg"))
{
using (var localImage = image.AsStream())
{
localImage.CopyTo(file);
file.Flush();
}
}
}
STEP 2 : SAVE HIGH RES TO LOCAL STORAGE
STEP 3 : DO YOUR MAGIC
This is easy to do, using the Nokia Imaging SDK.
STEP 4: SCALE DOWN THE RESULTING IMAGE TO 5MP
var library = new Microsoft.Xna.Framework.Media.MediaLibrary())
{
using (var picture = library.SavePictureToCameraRoll(filenameBase, libraryImage))
{
savedPath = picture.GetPath();
}
}
}
STEP 5 : SAVE THE 5MP IMAGE TO CAMERA
ROLL
Register your app as a rich media application (in
WMAppManifest.xml)
When launched, the NavigationContext.QueryString of
your application will contain the 2 keys:
{[Action, RichMediaEdit]}
{[token, {9b6bb83d-18db-45d3-9ab1-44b7a80ff2ab}]}]
In your OnNavigatedTo, match the photo coming from
the media library files with the locally saved photo
STEP 6: IMPLEMENT THE RICH MEDIA EXTENSION
protected override void OnNavigatedTo(NavigationEventArgs e)
{ …
var queryString = this.NavigationContext.QueryString;
if (queryString.ContainsKey("token"))
{
using (Microsoft.Xna.Framework.Media.Picture picture = library.GetPictureFromToken(token))
{
var localPath = picture.GetPath();
/* ... Some code removed here : Parse the path to retrieve the filename */
using (var store = IsolatedStorageFile.GetUserStoreForApplication())
{
if (store.FileExists(localPathCandidate))
{
return store.OpenFile(localPathCandidate, FileMode.Open);
}
}
MATCH LOCAL FILE AND MEDIA LIBRARY FILE
• High resolution images are huge in size : Offer a way for users to delete the
images you’re keeping in the local storage.
• It is a good practice to automatically check if the image has been deleted
from the media library.
STEP 7 : KEEP APPLICATION LOCAL STORAGE CLEAN
Your application will capture amazing images on the Nokia Lumia 1020!
If you decide to capture high res images:
• Follow the code sample from the “Photo Inspector”.
• Be nice with your other third-party applications: don’t save high
resolution images to camera roll.
• Use the Nokia Imaging SDK for scaling and cropping operations.
SUMMARY
• Imaging in the Lumia Developer’s Library: http://nokia.ly/WP_lib_img
• Photo Inspector example application: http://nokia.ly/PhotoInspector
• Nokia Imaging SDK: http://www.developer.nokia.com/imaging
• Nokia Imaging discussion board: http://nokia.ly/DiBoImg
• Lumia 1020 White paper: http://nokia.ly/N1020WhiteP
• Windows Phone: Building a Camera App:
http://channel9.msdn.com/Events/Build/2013/2-210
• Rich media extensibility for Windows Phone 8:
http://msdn.microsoft.com/en-
us/library/windowsphone/develop/jj662942(v=vs.105).aspx
RESOURCES
THANK YOU!
NOKIA
IMAGING WIKI
COMPETITION
2013Q3
Write a great tutorial, guide or an article with code which
shows how to use the Nokia Imaging SDK or Camera and any
other Windows Phone APIs related to imaging in useful,
imaginative and innovative ways and/or provide the best
feedback on the Nokia Imaging SDK.
developer.nokia.com/Community/Wiki/

Más contenido relacionado

La actualidad más candente

The ultimate guide to digital photography
The ultimate guide to digital photographyThe ultimate guide to digital photography
The ultimate guide to digital photographyEny Duta
 
Jolla smartphone review in pictures
Jolla smartphone review in picturesJolla smartphone review in pictures
Jolla smartphone review in pictures91mobiles
 
Nokia X2 review
Nokia X2 reviewNokia X2 review
Nokia X2 review91mobiles
 
Nokia x review in pictures
Nokia x review in picturesNokia x review in pictures
Nokia x review in pictures91mobiles
 
BlackBerry Z3 review
BlackBerry Z3 reviewBlackBerry Z3 review
BlackBerry Z3 review91mobiles
 
Nexus 5 review in pictures
Nexus 5 review in picturesNexus 5 review in pictures
Nexus 5 review in pictures91mobiles
 
iBall Andi Enigma - The Perfect Selfie Phone
iBall Andi Enigma - The Perfect Selfie PhoneiBall Andi Enigma - The Perfect Selfie Phone
iBall Andi Enigma - The Perfect Selfie PhoneiBall
 
Camera research
Camera researchCamera research
Camera researchjojo6774
 
Create your own sixth sense device
Create your own sixth sense deviceCreate your own sixth sense device
Create your own sixth sense deviceFaheem Nazir
 
Understanding DSLR Cameras
Understanding DSLR CamerasUnderstanding DSLR Cameras
Understanding DSLR CamerasGabriel Vasquez
 
Nokia Lumia 1020 Demo Guide 8-19-13
Nokia Lumia 1020 Demo Guide 8-19-13Nokia Lumia 1020 Demo Guide 8-19-13
Nokia Lumia 1020 Demo Guide 8-19-13Brian Weaver
 
Oppo N1 Mini review in pictures
Oppo N1 Mini review in picturesOppo N1 Mini review in pictures
Oppo N1 Mini review in pictures91mobiles
 
Panasonic P81 review
Panasonic P81 reviewPanasonic P81 review
Panasonic P81 review91mobiles
 
Marketing plan for a mobile app
Marketing plan for a mobile app Marketing plan for a mobile app
Marketing plan for a mobile app Keshav Agarwal
 
Xiaomi Mi 4i review
Xiaomi Mi 4i reviewXiaomi Mi 4i review
Xiaomi Mi 4i review91mobiles
 
Microsoft Lumia 535 review in pictures
Microsoft Lumia 535 review in pictures Microsoft Lumia 535 review in pictures
Microsoft Lumia 535 review in pictures 91mobiles
 
Lenovo A6000 Plus review in pictures
Lenovo A6000 Plus review in picturesLenovo A6000 Plus review in pictures
Lenovo A6000 Plus review in pictures91mobiles
 

La actualidad más candente (20)

Technology
TechnologyTechnology
Technology
 
The ultimate guide to digital photography
The ultimate guide to digital photographyThe ultimate guide to digital photography
The ultimate guide to digital photography
 
PhoneOgraphy
PhoneOgraphyPhoneOgraphy
PhoneOgraphy
 
Jolla smartphone review in pictures
Jolla smartphone review in picturesJolla smartphone review in pictures
Jolla smartphone review in pictures
 
Nokia X2 review
Nokia X2 reviewNokia X2 review
Nokia X2 review
 
Nokia x review in pictures
Nokia x review in picturesNokia x review in pictures
Nokia x review in pictures
 
BlackBerry Z3 review
BlackBerry Z3 reviewBlackBerry Z3 review
BlackBerry Z3 review
 
Nexus 5 review in pictures
Nexus 5 review in picturesNexus 5 review in pictures
Nexus 5 review in pictures
 
iBall Andi Enigma - The Perfect Selfie Phone
iBall Andi Enigma - The Perfect Selfie PhoneiBall Andi Enigma - The Perfect Selfie Phone
iBall Andi Enigma - The Perfect Selfie Phone
 
Camera research
Camera researchCamera research
Camera research
 
Create your own sixth sense device
Create your own sixth sense deviceCreate your own sixth sense device
Create your own sixth sense device
 
Understanding DSLR Cameras
Understanding DSLR CamerasUnderstanding DSLR Cameras
Understanding DSLR Cameras
 
Nokia Lumia 1020 Demo Guide 8-19-13
Nokia Lumia 1020 Demo Guide 8-19-13Nokia Lumia 1020 Demo Guide 8-19-13
Nokia Lumia 1020 Demo Guide 8-19-13
 
Oppo N1 Mini review in pictures
Oppo N1 Mini review in picturesOppo N1 Mini review in pictures
Oppo N1 Mini review in pictures
 
Panasonic P81 review
Panasonic P81 reviewPanasonic P81 review
Panasonic P81 review
 
Marketing plan for a mobile app
Marketing plan for a mobile app Marketing plan for a mobile app
Marketing plan for a mobile app
 
Xiaomi Mi 4i review
Xiaomi Mi 4i reviewXiaomi Mi 4i review
Xiaomi Mi 4i review
 
Microsoft Lumia 535 review in pictures
Microsoft Lumia 535 review in pictures Microsoft Lumia 535 review in pictures
Microsoft Lumia 535 review in pictures
 
Photo recovery for mac
Photo recovery for macPhoto recovery for mac
Photo recovery for mac
 
Lenovo A6000 Plus review in pictures
Lenovo A6000 Plus review in picturesLenovo A6000 Plus review in pictures
Lenovo A6000 Plus review in pictures
 

Similar a LUMIA APP LABS #14: WORKING WITH HIGH-RESOLUTION IMAGES IN WINDOWS PHONE 8

Windows Phone 8 - 17 The Windows Phone Store
Windows Phone 8 - 17 The Windows Phone StoreWindows Phone 8 - 17 The Windows Phone Store
Windows Phone 8 - 17 The Windows Phone StoreOliver Scheer
 
UplinQ - implementing computational camera
UplinQ - implementing computational cameraUplinQ - implementing computational camera
UplinQ - implementing computational cameraSatya Harish
 
Smart Face Recognition System Analysis
Smart Face Recognition System AnalysisSmart Face Recognition System Analysis
Smart Face Recognition System AnalysisVishal Aditya
 
Computer architecture for vision system
Computer architecture for vision systemComputer architecture for vision system
Computer architecture for vision systemAkashPatil334
 
How to Master Raster (Faster) - Tips and Examples
How to Master Raster (Faster) - Tips and ExamplesHow to Master Raster (Faster) - Tips and Examples
How to Master Raster (Faster) - Tips and ExamplesSafe Software
 
Gigapixel Photography: RCAHMW
Gigapixel Photography: RCAHMWGigapixel Photography: RCAHMW
Gigapixel Photography: RCAHMWRCAHMW
 
Circuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPCircuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPguest022763
 
Circuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPCircuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPChema Alonso
 
Back to FME School - Day 3: Expanding Frontiers
Back to FME School - Day 3: Expanding FrontiersBack to FME School - Day 3: Expanding Frontiers
Back to FME School - Day 3: Expanding FrontiersSafe Software
 
Using intel's real sense to create games with natural user interfaces justi...
Using intel's real sense to create games with natural user interfaces   justi...Using intel's real sense to create games with natural user interfaces   justi...
Using intel's real sense to create games with natural user interfaces justi...BeMyApp
 
06.Programming Media on Windows Phone
06.Programming Media on Windows Phone06.Programming Media on Windows Phone
06.Programming Media on Windows PhoneNguyen Tuan
 
Picture Recovery Software:- Retrieves all lost and deleted digital Photos
Picture Recovery Software:- Retrieves all lost and deleted digital PhotosPicture Recovery Software:- Retrieves all lost and deleted digital Photos
Picture Recovery Software:- Retrieves all lost and deleted digital PhotosAlisa Smith
 
Titanium appcelerator best practices
Titanium appcelerator best practicesTitanium appcelerator best practices
Titanium appcelerator best practicesAlessio Ricco
 
Ml goes fruitful
Ml goes fruitfulMl goes fruitful
Ml goes fruitfulPreeti Negi
 
7.imaging on windows phone
7.imaging on windows phone7.imaging on windows phone
7.imaging on windows phoneNguyên Phạm
 
Lumia App Labs #17: Optimising your Nokia Lumia apps for large screen phones
Lumia App Labs #17: Optimising your Nokia Lumia apps for large screen phonesLumia App Labs #17: Optimising your Nokia Lumia apps for large screen phones
Lumia App Labs #17: Optimising your Nokia Lumia apps for large screen phonesLucian Tomuța
 
HTC Developer - 2012
HTC Developer - 2012HTC Developer - 2012
HTC Developer - 2012Bruce Jones
 
Android 5.0 Camera2 APIs
Android 5.0 Camera2 APIsAndroid 5.0 Camera2 APIs
Android 5.0 Camera2 APIsBalwinder Kaur
 
Emerging vision technologies
Emerging vision technologiesEmerging vision technologies
Emerging vision technologiesQualcomm Research
 

Similar a LUMIA APP LABS #14: WORKING WITH HIGH-RESOLUTION IMAGES IN WINDOWS PHONE 8 (20)

Windows Phone 8 - 17 The Windows Phone Store
Windows Phone 8 - 17 The Windows Phone StoreWindows Phone 8 - 17 The Windows Phone Store
Windows Phone 8 - 17 The Windows Phone Store
 
UplinQ - implementing computational camera
UplinQ - implementing computational cameraUplinQ - implementing computational camera
UplinQ - implementing computational camera
 
Implementing Computational Camera
Implementing Computational CameraImplementing Computational Camera
Implementing Computational Camera
 
Smart Face Recognition System Analysis
Smart Face Recognition System AnalysisSmart Face Recognition System Analysis
Smart Face Recognition System Analysis
 
Computer architecture for vision system
Computer architecture for vision systemComputer architecture for vision system
Computer architecture for vision system
 
How to Master Raster (Faster) - Tips and Examples
How to Master Raster (Faster) - Tips and ExamplesHow to Master Raster (Faster) - Tips and Examples
How to Master Raster (Faster) - Tips and Examples
 
Gigapixel Photography: RCAHMW
Gigapixel Photography: RCAHMWGigapixel Photography: RCAHMW
Gigapixel Photography: RCAHMW
 
Circuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPCircuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IP
 
Circuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPCircuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IP
 
Back to FME School - Day 3: Expanding Frontiers
Back to FME School - Day 3: Expanding FrontiersBack to FME School - Day 3: Expanding Frontiers
Back to FME School - Day 3: Expanding Frontiers
 
Using intel's real sense to create games with natural user interfaces justi...
Using intel's real sense to create games with natural user interfaces   justi...Using intel's real sense to create games with natural user interfaces   justi...
Using intel's real sense to create games with natural user interfaces justi...
 
06.Programming Media on Windows Phone
06.Programming Media on Windows Phone06.Programming Media on Windows Phone
06.Programming Media on Windows Phone
 
Picture Recovery Software:- Retrieves all lost and deleted digital Photos
Picture Recovery Software:- Retrieves all lost and deleted digital PhotosPicture Recovery Software:- Retrieves all lost and deleted digital Photos
Picture Recovery Software:- Retrieves all lost and deleted digital Photos
 
Titanium appcelerator best practices
Titanium appcelerator best practicesTitanium appcelerator best practices
Titanium appcelerator best practices
 
Ml goes fruitful
Ml goes fruitfulMl goes fruitful
Ml goes fruitful
 
7.imaging on windows phone
7.imaging on windows phone7.imaging on windows phone
7.imaging on windows phone
 
Lumia App Labs #17: Optimising your Nokia Lumia apps for large screen phones
Lumia App Labs #17: Optimising your Nokia Lumia apps for large screen phonesLumia App Labs #17: Optimising your Nokia Lumia apps for large screen phones
Lumia App Labs #17: Optimising your Nokia Lumia apps for large screen phones
 
HTC Developer - 2012
HTC Developer - 2012HTC Developer - 2012
HTC Developer - 2012
 
Android 5.0 Camera2 APIs
Android 5.0 Camera2 APIsAndroid 5.0 Camera2 APIs
Android 5.0 Camera2 APIs
 
Emerging vision technologies
Emerging vision technologiesEmerging vision technologies
Emerging vision technologies
 

Más de Microsoft Mobile Developer

Intro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsIntro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsMicrosoft Mobile Developer
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagMicrosoft Mobile Developer
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsMicrosoft Mobile Developer
 
Windows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appWindows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appMicrosoft Mobile Developer
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeMicrosoft Mobile Developer
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoMicrosoft Mobile Developer
 

Más de Microsoft Mobile Developer (20)

Intro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsIntro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and tools
 
Lumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK betaLumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK beta
 
Nokia Asha from idea to app - Imaging
Nokia Asha from idea to app - ImagingNokia Asha from idea to app - Imaging
Nokia Asha from idea to app - Imaging
 
Healthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia AshaHealthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia Asha
 
Push notifications on Nokia X
Push notifications on Nokia XPush notifications on Nokia X
Push notifications on Nokia X
 
DIY Nokia Asha app usability studies
DIY Nokia Asha app usability studiesDIY Nokia Asha app usability studies
DIY Nokia Asha app usability studies
 
Lessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviewsLessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviews
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tag
 
HERE Maps for the Nokia X platform
HERE Maps for the Nokia X platformHERE Maps for the Nokia X platform
HERE Maps for the Nokia X platform
 
Nokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerationsNokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerations
 
Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)
 
UX considerations when porting to Nokia X
UX considerations when porting to Nokia XUX considerations when porting to Nokia X
UX considerations when porting to Nokia X
 
Kids' games and educational app design
Kids' games and educational app designKids' games and educational app design
Kids' games and educational app design
 
Nokia X: opportunities for developers
Nokia X: opportunities for developersNokia X: opportunities for developers
Nokia X: opportunities for developers
 
Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1
 
Intro to Nokia X software platform and tools
Intro to Nokia X software platform and toolsIntro to Nokia X software platform and tools
Intro to Nokia X software platform and tools
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
 
Windows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appWindows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra app
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo store
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progetto
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

LUMIA APP LABS #14: WORKING WITH HIGH-RESOLUTION IMAGES IN WINDOWS PHONE 8

  • 1. WORKING WITH HIGH-RESOLUTION IMAGES LUMIA APP LABS #14 Berthier Lemieux Technology Wizard
  • 2. Sensor size 1/1.5” Pixel size 1.1 micron Optical Image Stabilization Total sensor : 7712x5360 = 41.3MP 16:9 mode : 7712x4352 = 33.6 MP 4:3 mode : 7136x5360 = 38.2 MP NOKIA LUMIA 1020 CAMERA SENSOR
  • 3. • By default, the PhotoCaptureDevice doesn’t expose the 34 or 38 megapixels resolutions. • Applications needs to specifically be aware of that resolution. 5 MP OR HIGH RES? Without any changes, your app will capture 5 MP images and they will look awesome!
  • 5. BE NICE TO YOUR NEIGHBOURS! High res images requires special attention and may break other applications. Don’t save full resolution images to the camera roll.
  • 6. The camera application saves both the full resolution and an oversampled image simultaneously. DUAL CAPTURE IN NOKIA CAMERA PRO
  • 7. Use the data contained in the full resolution image to create the best 5MP image. OVERSAMPLING 7136 5360 2592 1936 38.2 MP 5 MP Standard 5 MP Oversampled 5 MP
  • 8. • The high resolution image is saved locally to the application. • The high resolution image file, the ”original”, will never be modified. That file can’t be accessed through the PhotoPickerTask. • An oversampled (5 MP) image is saved to the camera roll. • Whenever they desire, the user can reframe the image; change where and how deep they want to zoom in on the image. A new oversampled (5 MP) image is saved to the camera roll, overwriting the existing one. • It is highly recommended to follow a similar design pattern in your application. DUAL CAPTURE IN NOKIA CAMERA PRO
  • 9. Download the code from developer.nokia.com SAMPLE APP: PHOTO INSPECTOR
  • 10. 1. Capture a high resolution image. 2. Save it to your local storage. 3. Do your magic. 4. Scale down the resulting image to 5MP. 5. Save the 5MP image to the camera roll. 6. Implement the Rich Media extension. 7. Keep application local storage clean. STEPS
  • 11. captureResolution = PhotoCaptureDevice.GetAvailableCaptureResolutions(SENSOR_LOCATION).First(); var deviceName = Microsoft.Phone.Info.DeviceStatus.DeviceName; if (deviceName.Contains("RM-875") || deviceName.Contains("RM-876") || deviceName.Contains("RM-877")) { // We now knows that the application runs on a Lumia 1020 captureResolution = new Windows.Foundation.Size(7712, 4352); // 16:9 ratio //captureResolution = new Windows.Foundation.Size(7136, 5360); // 4:3 ratio } _device = await PhotoCaptureDevice.OpenAsync(SENSOR_LOCATION, captureResolution); STEP 1 : CAPTURE A HIGH RESOLUTION IMAGE
  • 12. using (var store = IsolatedStorageFile.GetUserStoreForApplication()) { var localPath = @"LocalImages"; if (!store.DirectoryExists(localPath)) { store.CreateDirectory(localPath); } using (var file = store.CreateFile(localPath + @"" + filenameBase + @".jpg")) { using (var localImage = image.AsStream()) { localImage.CopyTo(file); file.Flush(); } } } STEP 2 : SAVE HIGH RES TO LOCAL STORAGE
  • 13. STEP 3 : DO YOUR MAGIC
  • 14. This is easy to do, using the Nokia Imaging SDK. STEP 4: SCALE DOWN THE RESULTING IMAGE TO 5MP
  • 15. var library = new Microsoft.Xna.Framework.Media.MediaLibrary()) { using (var picture = library.SavePictureToCameraRoll(filenameBase, libraryImage)) { savedPath = picture.GetPath(); } } } STEP 5 : SAVE THE 5MP IMAGE TO CAMERA ROLL
  • 16. Register your app as a rich media application (in WMAppManifest.xml) When launched, the NavigationContext.QueryString of your application will contain the 2 keys: {[Action, RichMediaEdit]} {[token, {9b6bb83d-18db-45d3-9ab1-44b7a80ff2ab}]}] In your OnNavigatedTo, match the photo coming from the media library files with the locally saved photo STEP 6: IMPLEMENT THE RICH MEDIA EXTENSION
  • 17. protected override void OnNavigatedTo(NavigationEventArgs e) { … var queryString = this.NavigationContext.QueryString; if (queryString.ContainsKey("token")) { using (Microsoft.Xna.Framework.Media.Picture picture = library.GetPictureFromToken(token)) { var localPath = picture.GetPath(); /* ... Some code removed here : Parse the path to retrieve the filename */ using (var store = IsolatedStorageFile.GetUserStoreForApplication()) { if (store.FileExists(localPathCandidate)) { return store.OpenFile(localPathCandidate, FileMode.Open); } } MATCH LOCAL FILE AND MEDIA LIBRARY FILE
  • 18. • High resolution images are huge in size : Offer a way for users to delete the images you’re keeping in the local storage. • It is a good practice to automatically check if the image has been deleted from the media library. STEP 7 : KEEP APPLICATION LOCAL STORAGE CLEAN
  • 19. Your application will capture amazing images on the Nokia Lumia 1020! If you decide to capture high res images: • Follow the code sample from the “Photo Inspector”. • Be nice with your other third-party applications: don’t save high resolution images to camera roll. • Use the Nokia Imaging SDK for scaling and cropping operations. SUMMARY
  • 20. • Imaging in the Lumia Developer’s Library: http://nokia.ly/WP_lib_img • Photo Inspector example application: http://nokia.ly/PhotoInspector • Nokia Imaging SDK: http://www.developer.nokia.com/imaging • Nokia Imaging discussion board: http://nokia.ly/DiBoImg • Lumia 1020 White paper: http://nokia.ly/N1020WhiteP • Windows Phone: Building a Camera App: http://channel9.msdn.com/Events/Build/2013/2-210 • Rich media extensibility for Windows Phone 8: http://msdn.microsoft.com/en- us/library/windowsphone/develop/jj662942(v=vs.105).aspx RESOURCES
  • 22. NOKIA IMAGING WIKI COMPETITION 2013Q3 Write a great tutorial, guide or an article with code which shows how to use the Nokia Imaging SDK or Camera and any other Windows Phone APIs related to imaging in useful, imaginative and innovative ways and/or provide the best feedback on the Nokia Imaging SDK. developer.nokia.com/Community/Wiki/