Form1.cs
(开头部分) 4KB这里只显示每个文件的开头 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.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Threading;
namespace 摄像头驱动
{
public partial class Main : Form
{
private const int WM_USER = 0x400;
private const int WS_CHILD = 0x40000000;
private const int WS_VISIBLE = 0x10000000;
private const int SWP_NOMOVE = 0x2;
private const int SWP_NOZORDER = 0x4;
private const int WM_CAP_START = WM_USER;
private const int WM_CAP_STOP = WM_CAP_START + 68;
private const int WM_CAP_SEQUENCE = WM_CAP_START + 62;
private const int WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20;
public Main()
{
InitializeComponent();
}
private Camera wc;
private void but_start_Click(object sender, EventArgs e)
{
// 下载于www.51aspx.com
this.wc = new Camera(this.panelPreview.Handle, this.panelPreview.Width, this.panelPreview.Height);
this.wc.StartWebCam();
}
private void but_stop_Click(object sender, EventArgs e)
{
Video.SendMessage(wc.lwndC, 0x40b, 0, 0);
// Video.DestroyWindow(wc.lwndC);
this.wc.CloseWebcam();
}
private void but_cut_Click(object sender, EventArgs e)
{
try
{
Video.SendMessage(wc.lwndC, 0x41e, 0, 0);
IDataObject obj1 = Clipboard.GetDataObject();
if (obj1.GetDataPresent(typeof(Bitmap)))
{
Image image1 = (Image)obj1.GetData(typeof(Bitmap));
SaveFileDialog SaveFileDialog1 = new SaveFileDialog();
SaveFileDialog1.FileName = DateTime.Now.ToString("yyyyMMddhhmmss");
SaveFileDialog1.Filter = "Image Files(*.JPG;*.GIF)|*.JPG;*.GIF|All files (*.*)|*.*";
if (SaveFileDialog1.ShowDialog() == DialogResult.OK)
{
image1.Save(SaveFileDialog1.FileName, ImageFormat.Bmp);
后面还有 81 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
