form1.cs

来自「vs2005串口编程示例,好多例子,是学习串口编程方面不错的资料」· CS 代码 · 共 57 行

CS
57
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Ex13_08
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
        }
        //声明视频类
        cVideo video;

        private void button1_Click(object sender, EventArgs e)
        {
            btnPlay.Enabled = false;
            btnStop.Enabled = true;
            btnPz.Enabled = true;
            video = new cVideo(pictureBox1.Handle, pictureBox1.Width, pictureBox1.Height);
            video.StartWebCam();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            btnPlay.Enabled = false;
            btnStop.Enabled = true;
            btnPz.Enabled = true;
            video = new cVideo(pictureBox1.Handle, pictureBox1.Width, pictureBox1.Height);
            video.StartWebCam();
        }

        private void b_stop_Click(object sender, EventArgs e)
        {
            btnPlay.Enabled = true;
            btnStop.Enabled = false;
            btnPz.Enabled = false;
            video.CloseWebcam();
        }

        private void btnPz_Click(object sender, EventArgs e)
        {
            video.GrabImage(pictureBox1.Handle, "d:\\a.bmp");
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?