資源簡介
提供了用C#語言進(jìn)行高拍儀拍照的一些簡單例子。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Collections;
using?System.Windows.Forms;
using?System.Runtime.InteropServices;
/*
[DllImport(“Dll.dll“)]
public?extern?static?string?DllFun();
*/
namespace?chdemo
{
????public?partial?class?Form1?:?Form
????{
????????//?初始化視頻
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?InitDll();
????????//
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?UnInitDll();
????????//取動態(tài)庫信息?sInfo為?存儲?信息字符串的緩存區(qū)?為?char[256]
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?GetLibInfo(char[]?sInfo);
????????
????????//?截圖??sPath保存路徑
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?GetPicture(char[]?sPathint?m_Percen);
????????//開始預(yù)覽視頻?pHwnd?為顯示視頻的窗體句柄
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?BeginVideo(IntPtr?pHwnd);
????????//暫停預(yù)覽視頻
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?PauseVideo();
????????//停止預(yù)覽視頻
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?StopVideo();
????????//?取視頻狀態(tài)?
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?GetVideoStatus();
????????//?設(shè)置視頻屬性?彈出系統(tǒng)的視頻設(shè)置框
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?SetVideo2();
????????// 設(shè)置轉(zhuǎn)動?Turn?=0?正常?1?上下轉(zhuǎn)?2?左轉(zhuǎn)?3?右轉(zhuǎn)
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?SetTurn(int?Turn);
????????//設(shè)置視頻大小及位置
????????[DllImport(“Dll.dll“)]
????????public?static?extern?int?SetPosi(int?leftint?topint?widthint?hight);
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????//初始化
????????private?void?btInit_Click(object?sender?EventArgs?e)
????????{
????????????InitDll();
????????}
????????//取lib信息
????????private?void?btLibInfo_Click(object?sender?EventArgs?e)
????????{
????????????char[]?sInfo?=?new?char[20];
????????????GetLibInfo(sInfo);
?
????????}
????????//?開始采集
????????private?void?btBeginCapture_Click(object?sender?EventArgs?e)
????????{
????????????BeginVideo(this.Handle);
????????}
????????//暫停采集
????????private?void?btPause_Click(object?sender?EventArgs?e)
????????{
????????????PauseVideo();
????????}
????????//停止采集
????????private?void?btStopCapture_Click(object?sender?EventArgs?e)
????????{
????????????StopVideo();
????????}
????????//采集狀態(tài)
????????private?void?btStatus_Click(object?sender?EventArgs?e)
????????{
????????}
????????//設(shè)置視頻
????????private?void?btSet_Click(object?sender?EventArgs?e)
????????{
????????????SetVideo2();
????????}
????????//截圖
????????private?void?Capture_Click(object?sender?EventArgs?e)
????????{
????????????//string?str=“c:\\111.bmp“;
????????????string?str?=?“?“;
????????????GetPicture(str.ToCharArray()?100);
????????}
????????//設(shè)置位置
???
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????11608??2012-12-27?16:20??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\chdemo\bin\Debug\chdemo.vshost.exe
?????文件???????5421??2012-12-27?17:54??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\chdemo\chdemo.csproj
?????文件????????524??2012-12-27?17:54??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\chdemo\chdemo.csproj.user
?????文件???????3723??2011-06-20?20:51??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\chdemo.csproj
?????文件????????214??2011-06-20?21:15??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\chdemo.csproj.user
?????文件????????908??2012-12-27?17:54??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\chdemo.sln
?????文件??????12288??2012-12-27?17:54??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\chdemo.suo
?????文件???????4128??2011-06-21?22:39??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\Form1.cs
?????文件??????12635??2011-06-21?22:39??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\Form1.Designer.cs
?????文件???????5814??2011-06-21?22:39??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\Form1.resx
?????文件????????487??2011-06-20?20:26??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\Program.cs
?????文件???????1344??2011-06-20?20:26??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\Properties\AssemblyInfo.cs
?????文件???????2862??2011-06-20?20:26??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\Properties\Resources.Designer.cs
?????文件???????5612??2011-06-20?20:26??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\Properties\Resources.resx
?????文件???????1091??2011-06-20?20:26??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\Properties\Settings.Designer.cs
?????文件????????249??2011-06-20?20:26??創(chuàng)合高拍儀編程示例\C#Demo\chdemo\Properties\Settings.settings
?????文件????????908??2011-06-20?20:26??創(chuàng)合高拍儀編程示例\C#Demo\chdemo.sln
?????文件??????16896??2011-09-02?16:05??創(chuàng)合高拍儀編程示例\C#Demo\chdemo.suo
?????文件??????22468??2012-12-13?13:51??創(chuàng)合高拍儀編程示例\ChDemo\ChDemo.aps
?????文件???????1976??2012-12-28?09:45??創(chuàng)合高拍儀編程示例\ChDemo\ChDemo.clw
?????文件???????2114??2012-05-16?22:17??創(chuàng)合高拍儀編程示例\ChDemo\ChDemo.cpp
?????文件???????4217??2011-06-03?21:12??創(chuàng)合高拍儀編程示例\ChDemo\ChDemo.dsp
?????文件????????537??2011-06-03?21:05??創(chuàng)合高拍儀編程示例\ChDemo\ChDemo.dsw
?????文件???????1324??2011-06-03?21:05??創(chuàng)合高拍儀編程示例\ChDemo\ChDemo.h
?????文件??????49664??2012-12-13?13:55??創(chuàng)合高拍儀編程示例\ChDemo\ChDemo.opt
?????文件???????3138??2012-12-13?13:54??創(chuàng)合高拍儀編程示例\ChDemo\ChDemo.plg
?????文件???????6896??2012-05-16?20:41??創(chuàng)合高拍儀編程示例\ChDemo\ChDemo.rc
?????文件???????9805??2012-05-18?02:55??創(chuàng)合高拍儀編程示例\ChDemo\ChDemoDlg.cpp
?????文件???????1850??2012-05-16?20:19??創(chuàng)合高拍儀編程示例\ChDemo\ChDemoDlg.h
?????文件?????225280??2012-02-29?16:40??創(chuàng)合高拍儀編程示例\ChDemo\Debug\-Dll.dll
............此處省略57個文件信息
評論
共有 條評論