求 c# 视频摄像 源代码

亲亲玲 2011-08-17 10:56:33
求 c# 视频摄像 源代码 拍出来的照 大小,谢谢
...全文
80 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wolf_ben 2011-08-17
  • 打赏
  • 举报
回复
+![Quote=引用 5 楼 sp1234 的回复:]
求代码,不如先自己搜索一下。

帮你搜索一下: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&a……
[/Quote]
mp6che 2011-08-17
  • 打赏
  • 举报
回复
拍出来的照 太大了,如何变小呢
Avoid 2011-08-17
  • 打赏
  • 举报
回复
C#.net编写摄像头驱动程序,用avicap32.dll
http://blog.csdn.net/zzmdegm/article/details/1915364
给分吧
亲亲玲 2011-08-17
  • 打赏
  • 举报
回复
好的,
mp6che 2011-08-17
  • 打赏
  • 举报
回复
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("加载视频失败,请检查是否有安装设备!", "拍照");

}
}



试试看





110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧