Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

(译)Nokia Imaging SDK —— 加强版照片捕获

From Wiki
Jump to: navigation, search

本文刚翻译一部分,先占个位置,稍后完成。原文链接在底部

WP Metro Icon Multimedia.png
SignpostIcon XAML 40.png
WP Metro Icon WP8.png
Article Metadata

测试基于
SDK: Windows Phone 8.0 SDK, Nokia Imaging SDK Beta 1

兼容于
文章
段博琼 在 09 Oct 2013 创建
最后由 hamishwillee 在 17 Oct 2013 编辑

简介

在过去的十年中手机集成的相机逐渐取代传统口袋中的相机。

开发一个提供先进拍照和图片处理的应用程序取决于两个方面 手机硬件和系统平台提供的照片捕获

API。诺基亚的新的系列设备与新的 Windows Phone8 先进的照片捕获 API 为你提供能够调节拍照

设备各种参数的权限,比如曝光时间、ISO、焦点位置和白平衡。

引用一个扩展演示示例应用程序,本文描述了如何初始化和使用相机,如何读取参数,该设备支持的问题

,如何设置参数,以及如何捕获和存储照片。


Windows Phone 8 增强的照片捕获 API

WP8 发布了全新的照片捕获 API,包含了可以高度配置相机参数。新的相机特性主要包括下面:

—获得或调整支持的相机参数:

static CameraCapturePropertyRange SupportedPropertyRange(CameraSensorLocation sensor, Guid propertyId)
static IReadOnlyList<object> GetSupportedPropertyValues(CameraSensorLocation sensor, Guid propertyId)
object GetProperty(Guid propertyId)
void SetProperty(Guid propertyId, object value)

—调用自动对焦,自动白平衡,自动曝光:

static bool IsFocusSupported(CameraSensorLocation sensor)
static bool IsFocusRegionSupported(CameraSensorLocation sensor)
IAsyncOperation<CameraFocusStatus> FocusAsync()
IAsyncOperation<CameraFocusStatus> ResetFocusAsync()


—检查、设置预览、拍摄的分辨率

static IReadOnlyList<Size> GetAvailablePreviewResolutions()
static IReadOnlyList<Size> GetAvailableCaptureResolutions()
IAsyncAction SetPreviewResolutionAsync(Size value)
IAsyncAction SetCaptureResolutionAsync(Size value)

—读取预览缓冲区:

event TypedEventHandler<ICameraCaptureDevice, Object> PreviewFrameAvailable
void GetPreviewBufferArgb(out int[] pixels)
void GetPreviewBufferY(out byte[] pixels)
void GetPreviewBufferYCbCr(out byte[] pixels)

—创建捕获序列,然后用来捕捉帧:

CameraCaptureSequence CreateCaptureSequence(uint numberOfFrames)
IAsyncAction PrepareCaptureSequenceAsync(CameraCaptureSequence sequence)


获取相机参数主要基于三种不同的方式。预览、读取捕获的分辨率和通过专门的同步方法设置。

同样对焦的操作 API 中也有相应的特定方法。图像特定参数的调整依赖于方法中标注参数的 GUID,

来声明参数值所支持的范围,和方法设置所支持的值。

图像拍照指定的参数取值一般都是范围值或者既定的数组值,比如 ISO,指定在一个最大值和一个

最小值,在这之间的值都是合法的。数组类型的参数由可能的值的列表组成,特别是设备上合法的枚举值。

需要注意的是在应用中做上面的工作之前需要在清单文件 WMAppManifest.xml 中添加ID_CAP_ISV_CAMERA 权限声明。

另外,保存图片到图片库需要添加 ID_CAP_MEDIALIB_PHOTO。

注意

上面只是 Wiki 的部分内容,先占个位置,稍后完成。

NOKIA wiki 原文链接:http://developer.nokia.com/Resources/Library/Lumia/#!imaging/advanced-photo-capturing.html

Version Hint

Windows Phone: [[Category:Windows Phone]]
[[Category:Windows Phone 7.5]]
[[Category:Windows Phone 8]]

Nokia Asha: [[Category:Nokia Asha]]
[[Category:Nokia Asha Platform 1.0]]

Series 40: [[Category:Series 40]]
[[Category:Series 40 1st Edition]] [[Category:Series 40 2nd Edition]]
[[Category:Series 40 3rd Edition (initial release)]] [[Category:Series 40 3rd Edition FP1]] [[Category:Series 40 3rd Edition FP2]]
[[Category:Series 40 5th Edition (initial release)]] [[Category:Series 40 5th Edition FP1]]
[[Category:Series 40 6th Edition (initial release)]] [[Category:Series 40 6th Edition FP1]] [[Category:Series 40 Developer Platform 1.0]] [[Category:Series 40 Developer Platform 1.1]] [[Category:Series 40 Developer Platform 2.0]]

Symbian: [[Category:Symbian]]
[[Category:S60 1st Edition]] [[Category:S60 2nd Edition (initial release)]] [[Category:S60 2nd Edition FP1]] [[Category:S60 2nd Edition FP2]] [[Category:S60 2nd Edition FP3]]
[[Category:S60 3rd Edition (initial release)]] [[Category:S60 3rd Edition FP1]] [[Category:S60 3rd Edition FP2]]
[[Category:S60 5th Edition]]
[[Category:Symbian^3]] [[Category:Symbian Anna]] [[Category:Nokia Belle]]

This page was last modified on 17 October 2013, at 00:41.
124 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×