Windows UWP 客製照相功能
由於最近專案會需要用到在 Windows Mobile 10 手機上,針對鏡頭可以進行各項拍照功能微調,因此,根據研究與相關資料,將手機拍照功能整理出這份文件。
關於應用程式生命週期管理
- 在進入到特定頁面,該頁面要顯示手機鏡頭的預覽畫面的時候,需要根據Windows UWP 的應用程式生命週期,訂閱
Application.Current.Suspending & Application.Current.Resuming 這兩個事件,在前者,您需要將拍照鏡頭的資源予以釋放,而在後者,需要取得拍照功能的資源。
- 您可以使用
DeviceInformation.FindAllAsync(DeviceClass.VideoCapture)方法,取得裝置上的所有鏡頭裝置,並且針對前鏡頭或者後鏡頭進行處理。
- 建立
MediaCapture類別物件與MediaCaptureInitializationSettings類別物件,準備根據不同的條件,調整鏡頭拍照的參數。例如,可以使用這個方法,await _mediaCapture.InitializeAsync(settings);進行拍照裝置的初始化。
- 關於
MediaCapture類別說明文件與MediaCaptureInitializationSettings類別說明文件,可以分別參考 MediaCapture & MediaCaptureInitializationSettings
- 透過
MediaCapture.VideoDeviceController 取得的物件,其類型為 VideoDeviceController,可用於控制拍照裝置的各種行為,參考文件為 VideoDeviceController
- BacklightCompensation
提供取得和設定背光補償之方法, 如果值為 1,則啟用背光補償。如果值為 0,則停用背光補償
- Brightness
提供用於獲取和設置明亮度方法
- Contrast
提供用於獲取和設置對比度方法
- Exposure
提供用於獲取和設置曝光時間的方法
- FlashControl
拍照設備的閃光控制。FlashControl類別 具有下列類型的成員 Auto / Enabled / PowerPercent / PowerSupported / RedEyeReduction / RedEyeReductionSupported / Supported
- Focus
提供方法來獲取和設置焦點
- Hue
Gets or sets the camera’s hue setting
- IsoSpeedControl
Gets the ISO film speed control for this video device
- LowLagPhoto
Gets the low shutter lag photo control for this video device
- LowLagPhotoSequence
Gets the low shutter lag photo sequence control for this video device
- Pan
獲取或設置相機的Pan
- PrimaryUse
獲取或設置該主要使用設備
- RegionsOfInterestControl
此視頻的設備獲取利益控制的區域
- Roll
獲取或設置相機的膠卷(設置
- SceneModeControl
此視頻的設備獲取場景模式控制
- Tilt
獲取或設置相機的移軸模式設置
- TorchControl
獲取此視頻設備的亮燈手電筒模式控制
- WhiteBalance
獲取或設置在相機的白平衡
- WhiteBalanceControl
獲取此視頻設備的白平衡控制
- Zoom
獲取和設置相機的放大與縮小
其他參考
Universal Windows 10 SDK: Adding GPS to the Camera Sample
沒有留言:
張貼留言