ScreenToGif/Webcam/DirectX/CaptureWebcam.cs

(开头部分) 24KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;
using ScreenToGif.Webcam.DirectShow;

namespace ScreenToGif.Webcam.DirectX
{
    /// <summary>
    /// Gets the video output of a webcam or other video device.
    /// </summary>
    public class CaptureWebcam : EditStreaming.ISampleGrabberCB, IDisposable
    {
        #region Properties

        /// <summary> 
        ///  The video capture device filter. Read-only. To use a different 
        ///  device, dispose of the current Capture instance and create a new 
        ///  instance with the desired device. 
        /// </summary>
        public Filter VideoDevice { get; private set; }

        /// <summary>
        ///  The control that will host the preview window. 
        /// </summary>
        public ContentControl PreviewWindow { get; set; }

        /// <summary>
        /// The Height of the video feed.
        /// </summary>
        public int Height
        {
            get
            {
                if (_videoInfoHeader != null)
                    return _videoInfoHeader.BmiHeader.Height;

                return -1;
            }
        }

        /// <summary>
        /// The Width of the video feed.
        /// </summary>
        public int Width
        {
            get
            {
                if (_videoInfoHeader != null)
                    return _videoInfoHeader.BmiHeader.Width;

                return -1;
            }
        }

        /// <summary>
        /// The Scale of the video feed.
        /// </summary>
后面还有 618 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。