資源簡介
代碼片段和文件信息
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.Runtime.InteropServices;
namespace?打開攝像頭
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????}
????????///?
????????///?Form1?handle.?
????????///?
????????private?int?hHwnd;
????????public?struct?videohdr_tag
????????{
????????????public?byte[]?lpData;
????????????public?int?dwBufferLength;
????????????public?int?dwBytesUsed;
????????????public?int?dwTimeCaptured;
????????????public?int?dwUser;
????????????public?int?dwFlags;
????????????public?int[]?dwReserved;
????????}
????????#region?P/Invoke
????????[DllImport(“avicap32.dll“?CharSet?=?CharSet.Ansi?SetLastError?=?true?ExactSpelling?=?true)]
????????public?static?extern?int?capCreateCaptureWindowA([MarshalAs(UnmanagedType.VBByRefStr)]???ref?string?lpszWindowName?int?dwstyle?int?x?int?y?int?nWidth?short?nHeight?int?hWndParent?int?nID);
????????[DllImport(“avicap32.dll“?CharSet?=?CharSet.Ansi?SetLastError?=?true?ExactSpelling?=?true)]
????????public?static?extern?bool?capGetDriverDescriptionA(short?wDriver?[MarshalAs(UnmanagedType.VBByRefStr)]???ref?string?lpszName?int?cbName?[MarshalAs(UnmanagedType.VBByRefStr)]???ref?string?lpszVer?int?cbVer);
????????[DllImport(“user32“?CharSet?=?CharSet.Ansi?SetLastError?=?true?ExactSpelling?=?true)]
????????public?static?extern?bool?DestroyWindow(int?hndw);
????????[DllImport(“user32“?EntryPoint?=?“SendMessageA“?CharSet?=?CharSet.Ansi?SetLastError?=?true?ExactSpelling?=?true)]
????????public?static?extern?int?SendMessage(int?hwnd?int?wMsg?int?wParam?[MarshalAs(UnmanagedType.AsAny)]???object?lParam);
????????[DllImport(“user32“?CharSet?=?CharSet.Ansi?SetLastError?=?true?ExactSpelling?=?true)]
????????public?static?extern?int?SetWindowPos(int?hwnd?int?hWndInsertAfter?int?x?int?y?int?cx?int?cy?int?wFlags);
????????[DllImport(“vfw32.dll“)]
????????public?static?extern?string?capVideoStreamCallback(int?hwnd?videohdr_tag?videohdr_tag);
????????[DllImport(“vicap32.dll“?CharSet?=?CharSet.Ansi?SetLastError?=?true?ExactSpelling?=?true)]
????????public?static?extern?bool?capSetCallbackOnframe(int?hwnd?string?s);
????????#endregion
????????#region?初始化窗體1并在面板中顯示視頻
????????///?
????????///?Initialize?Form1?and?display?the?video?in?a?panel.
????????///?初始化窗體1并在面板中顯示視頻
????????///?display??展示??顯示
????????///?
????????///?
????????private?bool?InitializeForm1()??//初始化?計算機程序或者系統
????????{
????????????bool?ok?=?false;
????????????int?intWidth?=?this.pictureBox1.Width;
????????????int?intHeight?=?this.pictureBox1.Height;
????????????int?intDevice?=?0;
????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2020-04-13?10:40??打開攝像頭\
?????目錄???????????0??2020-04-13?09:19??打開攝像頭\.vs\
?????目錄???????????0??2020-04-13?09:19??打開攝像頭\.vs\打開攝像頭\
?????目錄???????????0??2020-04-13?09:19??打開攝像頭\.vs\打開攝像頭\v15\
?????文件???????20480??2020-04-13?10:41??打開攝像頭\.vs\打開攝像頭\v15\.suo
?????目錄???????????0??2020-04-13?09:19??打開攝像頭\.vs\打開攝像頭\v15\Server\
?????目錄???????????0??2020-04-13?09:19??打開攝像頭\.vs\打開攝像頭\v15\Server\sqlite3\
?????文件???????????0??2020-04-13?09:19??打開攝像頭\.vs\打開攝像頭\v15\Server\sqlite3\db.lock
?????文件??????561152??2020-04-13?10:37??打開攝像頭\.vs\打開攝像頭\v15\Server\sqlite3\storage.ide
?????文件???????32768??2020-04-13?09:19??打開攝像頭\.vs\打開攝像頭\v15\Server\sqlite3\storage.ide-shm
?????文件?????4136512??2020-04-13?10:41??打開攝像頭\.vs\打開攝像頭\v15\Server\sqlite3\storage.ide-wal
?????目錄???????????0??2020-04-13?09:19??打開攝像頭\bin\
?????目錄???????????0??2020-04-13?09:22??打開攝像頭\bin\Debug\
?????文件???????10752??2020-04-13?10:40??打開攝像頭\bin\Debug\打開攝像頭.exe
?????文件???????28160??2020-04-13?10:40??打開攝像頭\bin\Debug\打開攝像頭.pdb
?????文件????????5885??2020-04-13?10:40??打開攝像頭\Form1.cs
?????文件????????4468??2020-04-13?10:38??打開攝像頭\Form1.Designer.cs
?????文件????????5817??2020-04-13?10:38??打開攝像頭\Form1.resx
?????目錄???????????0??2020-04-13?09:19??打開攝像頭\obj\
?????目錄???????????0??2020-04-13?10:38??打開攝像頭\obj\Debug\
?????文件?????????827??2020-04-13?09:19??打開攝像頭\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6809??2020-04-13?09:20??打開攝像頭\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????目錄???????????0??2020-04-13?09:19??打開攝像頭\obj\Debug\TempPE\
?????文件??????????42??2020-04-13?09:19??打開攝像頭\obj\Debug\打開攝像頭.csproj.CoreCompileInputs.cache
?????文件?????????631??2020-04-13?10:22??打開攝像頭\obj\Debug\打開攝像頭.csproj.FileListAbsolute.txt
?????文件????????1012??2020-04-13?10:38??打開攝像頭\obj\Debug\打開攝像頭.csproj.GenerateResource.cache
?????文件???????10576??2020-04-13?09:19??打開攝像頭\obj\Debug\打開攝像頭.csprojAssemblyReference.cache
?????文件???????10752??2020-04-13?10:40??打開攝像頭\obj\Debug\打開攝像頭.exe
?????文件?????????180??2020-04-13?10:38??打開攝像頭\obj\Debug\打開攝像頭.Form1.resources
?????文件???????28160??2020-04-13?10:40??打開攝像頭\obj\Debug\打開攝像頭.pdb
?????文件?????????180??2020-04-13?09:22??打開攝像頭\obj\Debug\打開攝像頭.Properties.Resources.resources
............此處省略9個文件信息
評論
共有 條評論