博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
win8 metro MediaCapture 类
阅读量:5305 次
发布时间:2019-06-14

本文共 5718 字,大约阅读时间需要 19 分钟。

近期接触的项目是有关win8 metro 中camera的项目。当中比較重要的类就是 MediaCapture类,如今介绍一下MediaCapture类,也总结一下自己的一些项目体会:

以下是MediaCapture类的一些方法调用:

using System;using Windows.Foundation;using Windows.Foundation.Collections;using Windows.Foundation.Metadata;using Windows.Media;using Windows.Media.Devices;using Windows.Media.MediaProperties;using Windows.Storage;using Windows.Storage.Streams;namespace Windows.Media.Capture{    // Summary:    //     Provides functionality for capturing photos, audio, and videos from a capture    //     device, such as a webcam.    [Activatable(100794368)]    [DualApiPartition(version = 100794368)]    [MarshalingBehavior(MarshalingType.Standard)]    [Threading(ThreadingModel.MTA)]    [Version(100794368)]    public sealed class MediaCapture : IDisposable    {        //     创建一个MediaCapture对象的实例        public MediaCapture();        //返回一个控制microphone设置的对象。AudioDeviceController对象就是控制microphone设置的对象        public AudioDeviceController AudioDeviceController { get; }        //             //MediaCaptureSettings对象包括MediaCapture的设置。这个函数返回MediaCapture对象的设置        public MediaCaptureSettings MediaCaptureSettings { get; }        //            //返回一个对象,这个对象控制video camera的设置,VideoDeviceController就是这个对象        public VideoDeviceController VideoDeviceController { get; }        // Summary:        //  这是MediaCapture类的 Events。当在media 捕获的时候错误发生时发生这个事件        public event MediaCaptureFailedEventHandler Failed;        //        // Summary:        // 这也是MediaCapture类的Events,当超过记录的限制的时候会触发这个事件        public event RecordLimitationExceededEventHandler RecordLimitationExceeded;        // Summary:        //     Adds an audio or video effect.        //        // Parameters:        //   mediaStreamType:        //     Specifies the streams to which the effect will be applied.        //        //   effectActivationID:        //     The class identifier of the activatable runtime class that implements the        //     effect. The runtime class must implement the IMediaExtension interface.        //        //   effectSettings:        //     Configuration parameters for the effect.        //        // Returns:        //     Returns an IAsyncAction object that is used to control the asynchronous operation.        public IAsyncAction AddEffectAsync(MediaStreamType mediaStreamType, string effectActivationID, IPropertySet effectSettings);        //        // Summary:        //     Captures a photo to a storage file.        //        // Parameters:        //   type:        //     The encoding properties for the output image.        //        //   file:        //     The storage file where the image is saved.        //        // Returns:        //     Returns an IAsyncAction object that is used to control the asynchronous operation.        public IAsyncAction CapturePhotoToStorageFileAsync(ImageEncodingProperties type, IStorageFile file);        //        // Summary:        //     Captures a photo to a random-access stream.        //        // Parameters:        //   type:        //     The encoding properties for the output image.        //        //   stream:        //     The stream where the image data is written.        //        // Returns:        //     Returns an IAsyncAction object that is used to control the asynchronous operation.        public IAsyncAction CapturePhotoToStreamAsync(ImageEncodingProperties type, IRandomAccessStream stream);        //        // Summary:        //     Removes all audio and video effects from a stream.        //        // Parameters:        //   mediaStreamType:        //     The stream from which to remove the effects.        //        // Returns:        //     Returns a IAsyncAction object that is used to control the asynchronous operation.        public IAsyncAction ClearEffectsAsync(MediaStreamType mediaStreamType);        //        // Summary:        //     Performs tasks associated with freeing, releasing, or resetting unmanaged        //     resources.        public void Dispose();        //        // Summary:        //     Gets the value of an encoding property.        //        // Parameters:        //   mediaStreamType:        //     Specifies the stream to query for the encoding property.        //        //   propertyId:        //     The encoding property to retrieve.        //        // Returns:        //     Returns the value of the encoding property.        public object GetEncoderProperty(MediaStreamType mediaStreamType, Guid propertyId);        //        // Summary:        //     Queries whether the video stream is mirrored horizontally.        //        // Returns:        //     True if mirroring is enabled; false otherwise.        public bool GetPreviewMirroring();        //        // Summary:        //     Gets the rotation of the video preview stream.        //        // Returns:        //     The amount by which the video preview stream is rotated.        public VideoRotation GetPreviewRotation();        //        // Summary:        //     Gets the rotation of the recorded video.        //        // Returns:        //     The amount by which the recorded video is rotated.        public VideoRotation GetRecordRotation();        //        // Summary:        //     Initializes the MediaCapture object, using default settings.        //        // Returns:        //     Returns a IAsyncAction object that is used to control the asynchronous operation.        [Overload("InitializeAsync")]        public IAsyncAction InitializeAsync();        //        // Summary:        //     Initializes the MediaCapture object.        //        // Parameters:        //   mediaCaptureInitializationSettings:        //     The initialization settings.        //

转载于:https://www.cnblogs.com/jzdwajue/p/6852118.html

你可能感兴趣的文章
html语义化
查看>>
Lightoj 1016 - Brush (II)
查看>>
【代码笔记】iOS-NSLog的使用
查看>>
JavaScript 函数调用
查看>>
常见的磁盘I/O和网络I/O优化技巧
查看>>
java 利用反射完成自定义注解
查看>>
【2016常州一中夏令营Day4】
查看>>
php文件下载
查看>>
(4)[wp7数据存储] WP7 IsolatedStorage系列篇--读取、保存图片文件 [复制链接]
查看>>
C#让电脑发声,播放声音
查看>>
构造函数调用和复制构造函数调用
查看>>
silverlight的timer
查看>>
关于响应式布局
查看>>
Django ViewDoesNotExist error
查看>>
amazeui.css
查看>>
nginx 的uri、request_uri 区别
查看>>
发送邮件程序报错454 Authentication failed以及POP3和SMTP简介
查看>>
Weka开发[4]-特征选择
查看>>
Jenkins远程代码执行漏洞
查看>>
BZOJ 2752: [HAOI2012]高速公路(road)( 线段树 )
查看>>