11-硬件读写/摄像头大头贴/AMCap/Form1.cs

(开头部分) 5KB

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

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace AMCap
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        //声明视频类
        AMCap.baseClass.cVideo video;
        private void Form1_Load(object sender, EventArgs e)
        {
            video = new baseClass.cVideo(pictureBox1.Handle, pictureBox1.Width, pictureBox1.Height);
            video.StartWebCam();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DirectoryInfo di = new DirectoryInfo("c:\\AMCap");
            if (!di.Exists)
            {
                Directory.CreateDirectory("c:\\AMCap");
            }
            string path = "C:\\AMCap\\" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + ".jpeg";
            if (pictureBox2.Image != null)
            {
                Bitmap bt = new Bitmap(pictureBox2.Image);
                bt.Save(path, System.Drawing.Imaging.ImageFormat.Jpeg);
                bt.Dispose();
            }
            else
            {
                video.GrabImage(pictureBox1.Handle, path);
            }
            tsslPath.Text = "已经保存至:" + path;
        }

        Bitmap bt = null;
        Image ig;
        Graphics g;
        Bitmap btt = null;
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (bt != null)
                    bt.Dispose();
后面还有 97 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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