Related products: Video Capture SDK .Net

Video preview for web camera with frame capture (video tutorial with code) in Video Capture SDK .Net

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

using VisioForge.Types.OutputFormat;

namespace SampleCapture
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btStart_Click(object sender, EventArgs e)
        {
            videoCapture1.Video_CaptureDevice = videoCapture1.Video_CaptureDevicesInfo[0].Name;
            videoCapture1.Audio_CaptureDevice = videoCapture1.Audio_CaptureDevicesInfo[0].Name;
            videoCapture1.Mode = VisioForge.Types.VFVideoCaptureMode.VideoPreview;
            videoCapture1.Start();
        }

        private void btStop_Click(object sender, EventArgs e)
        {
            videoCapture1.Stop();
        }

        private void btSaveFrame_Click(object sender, EventArgs e)
        {
            videoCapture1.Frame_Save(
                Environment.GetFolderPath(Environment.SpecialFolder.MyPictures) + "\\frame.jpg",
                 VisioForge.Types.VFImageFormat.JPEG, 
                 85);
        }
    }
}

VisioForge © 2006-2019

  • GitHub-Mark-64px
  • Twitter Социальные Иконка
  • VisioForge Facebook page
  • YouTube channel