求 c# 视频摄像 源代码 求 c# 视频摄像 源代码 拍出来的照 大小,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public delegate bool CallBack(int hwnd, int lParam); /// <summary> /// 必需的设计器变量。 /// </summary> [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); private void OpenCapture() { int intWidth = this.panel1.Width; int intHeight = this.panel1.Height; int intDevice = 0; string refDevice = intDevice.ToString(); //创建视频窗口并得到句柄 hHwnd = CardReader.capCreateCaptureWindowA(ref refDevice, 1342177280, 0, 0, 160, 120, this.panel1.Handle.ToInt32(), 0); if (CardReader.SendMessage(hHwnd, 0x40a, intDevice, 0) > 0) { CardReader.SendMessage(this.hHwnd, 0x435, -1, 0); CardReader.SendMessage(this.hHwnd, 0x434, 0x42, 0); CardReader.SendMessage(this.hHwnd, 0x432, -1, 0); CardReader.SetWindowPos(this.hHwnd, 1, 0, 0, intWidth, intHeight, 6); } else { CardReader.DestroyWindow(this.hHwnd); MessageBox.Show("加载视频失败,请检查是否有安装设备!", "拍照"); } }试试看 C#.net编写摄像头驱动程序,用avicap32.dllhttp://blog.csdn.net/zzmdegm/article/details/1915364给分吧 求代码,不如先自己搜索一下。帮你搜索一下:http://www.google.com.hk/search?hl=zh-CN&newwindow=1&safe=strict&rlz=1I7GGLD_zh-CN&q=.net+%E6%91%84%E5%83%8F%E5%A4%B4&oq=.net+%E6%91%84%E5%83%8F%E5%A4%B4&aq=f&aqi=&aql=&gs_sm=e&gs_upl=73451l73617l0l74027l2l2l0l0l0l0l0l0ll0l0 如何抓取页面中JS生成的HTML代码? 关于记事本 保存与另存,请教! Button上画线。 小问题 请问如何判断post的来源地址是否来自本站 求一段登陆网站的客户端代码 c#操作xml问题,急 如何写一个可以获取本机网卡地址的组件? C++中涉及文件操作的函数如何写成C#? #####谁能推荐几本关于C#操作web方面的书,要求最好全是案例##### 请教,100分!!!! c# 如何读取CSV文件 请大家帮忙看看这简单的随机题怎么搞?
/// <summary>
/// 必需的设计器变量。
/// </summary>
[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);
private void OpenCapture()
{
int intWidth = this.panel1.Width;
int intHeight = this.panel1.Height;
int intDevice = 0;
string refDevice = intDevice.ToString();
//创建视频窗口并得到句柄
hHwnd = CardReader.capCreateCaptureWindowA(ref refDevice, 1342177280, 0, 0, 160, 120, this.panel1.Handle.ToInt32(), 0);
if (CardReader.SendMessage(hHwnd, 0x40a, intDevice, 0) > 0)
{
CardReader.SendMessage(this.hHwnd, 0x435, -1, 0);
CardReader.SendMessage(this.hHwnd, 0x434, 0x42, 0);
CardReader.SendMessage(this.hHwnd, 0x432, -1, 0);
CardReader.SetWindowPos(this.hHwnd, 1, 0, 0, intWidth, intHeight, 6);
}
else
{
CardReader.DestroyWindow(this.hHwnd);
MessageBox.Show("加载视频失败,请检查是否有安装设备!", "拍照"); }
}试试看
http://blog.csdn.net/zzmdegm/article/details/1915364
给分吧