当前位置:编程学习 > C#/ASP.NET >>

asp.net网站如何嵌入监控系统的实时画面

如题:大概需求是这样的,网站的每一个用户对应的一个监控的摄像头,当用户登录只能见与自己对应的摄像头的实时画面,比如有“aaaa”用户,与之对应的是“a1 摄像头“,当“aaaa”用户登录网站过后,就可以看到 “a1 摄像头”下的画面。
各位大侠有没有人做过啊,指点指点,或者提供个思路,当然有代码可以研究一下就最好了。谢谢
用户由系统分配就行,另整合一个论坛
还有做这样网站大概要多少钱? --------------------编程问答-------------------- 只能发100分的贴子,多的分给不了 --------------------编程问答-------------------- 沙发· --------------------编程问答-------------------- 自己顶上来,这个也沉得太快了
--------------------编程问答-------------------- 没做过
通过权限设置? --------------------编程问答--------------------
引用 4 楼 liguangmin2009 的回复:
没做过
通过权限设置?

权限到是好说,但是麻烦的是,我如何把摄像头上的画面或都通过什么样的方式,把他放到网页上呢,就像看世界杯网上直播的那种 --------------------编程问答-------------------- 高手呢,在线等待啊。
我的个妈呀,这觉得也忒快了 --------------------编程问答--------------------


C#捕捉视频头(源码)

using System;
using System.Runtime.InteropServices;

namespace Wuyin.ShoesManager
{
/// <summary>
/// VedioCapture 的摘要说明。
/// </summary>
public class VedioCapture
{
private int hCaptureM;
private bool isUnLoad = false;
public VedioCapture()
{
}
[DllImport("avicap32.dll")]
private static extern int capCreateCaptureWindow( string strWindowName, int dwStyle, int x, int y ,int width, int height , int hwdParent, int nID );
[DllImport("user32.dll")]
private static extern int SendMessage( int hwnd , int wMsg, int wParam , int lParam );
[DllImport("user32.dll")]
private static extern int SendMessage( int hwnd , int wMsg, int wParam , string lParam );
[DllImport("Kernel32.dll")]
private static extern bool CloseHandle( int hObject );
public bool Initialize( System.Windows.Forms.Control aContainer , int intWidth, int intHeight )
{
hCaptureM = capCreateCaptureWindow( "", 0x40000000 | 0x10000000, 0,0,intWidth,intHeight,aContainer.Handle.ToInt32() ,1 );
if( hCaptureM == 0 ) return false;

int ret = SendMessage( hCaptureM , 1034, 0,0 );
if( ret == 0 )
{
CloseHandle(hCaptureM);
return false;
}
//WM_CAP_SET_PREVIEW
ret = SendMessage( hCaptureM, 1074, 1, 0 );
if( ret == 0 )
{
this.UnLoad();
return false;
}
//WM_CAP_SET_SCALE
ret = SendMessage( hCaptureM, 1077, 1, 0 );
if( ret == 0 )
{
this.UnLoad();
return false;
}
//WM_CAP_SET_PREVIEWRATE
ret = SendMessage( hCaptureM, 1076, 66, 0 );
if( ret == 0 )
{
this.UnLoad();
return false;
}
return true;
}

public void SingleFrameBegin()
{
//
int ret = SendMessage( hCaptureM, 1094 , 0, 0 );
}
public void SingleFrameEnd()
{
//
int ret = SendMessage( hCaptureM, 1095 , 0, 0 );
}

public void SingleFrameMode()
{
//WM_CAP_GRAB_FRAME
int ret = SendMessage( hCaptureM, 1084 , 0, 0 );
//WM_CAP_SET_PREVIEW
//int ret = SendMessage( hCaptureM, 1074 , 0, 0 );
//WM_CAP_SINGLE_FRAME
//ret = SendMessage( hCaptureM, 1096 , 0, 0 );
}
public void PreviewMode()
{
int ret = SendMessage( hCaptureM, 1074 , 1, 0 );
}

public void UnLoad()
{
int ret = SendMessage( hCaptureM, 1035, 0, 0 );
CloseHandle( this.hCaptureM );
isUnLoad = true;
}

public void CopyToClipBorad()
{
int ret = SendMessage( hCaptureM, 1054, 0, 0 );
}

public void ShowFormatDialog()
{
int ret = SendMessage( hCaptureM, 1065, 0, 0 );
}
public void SaveToDIB( string fileName )
{
int ret = SendMessage( hCaptureM, 1049, 0, fileName );
}

public void ShowDisplayDialog()
{
int ret = SendMessage( hCaptureM, 1067, 0, 0 );
}
public System.Drawing.Image getCaptureImage()
{
System.Windows.Forms.IDataObject iData = System.Windows.Forms.Clipboard.GetDataObject();
System.Drawing.Image retImage = null;
if( iData != null )
{
if( iData.GetDataPresent( System.Windows.Forms.DataFormats.Bitmap ) )
{
retImage = (System.Drawing.Image)iData.GetData( System.Windows.Forms.DataFormats.Bitmap );
}
else if( iData.GetDataPresent( System.Windows.Forms.DataFormats.Dib ) )
{
retImage = (System.Drawing.Image)iData.GetData( System.Windows.Forms.DataFormats.Dib );
}
}
return retImage;
}

~VedioCapture()
{
if( !isUnLoad )
{
this.UnLoad();
}
}
}
}
先Initialize
然后display

--------------------编程问答-------------------- http://topic.csdn.net/u/20081119/17/f59b99aa-a0bb-4e86-9627-9e2d8e365eba.html

参考 --------------------编程问答-------------------- #7楼的到底行不行?? --------------------编程问答-------------------- 楼主啊   就我在给你忙活 搜源码 搜资料  记得多给我点分啊 --------------------编程问答--------------------
引用 7 楼 liguangmin2009 的回复:
C# code


C#捕捉视频头(源码)

using System;
using System.Runtime.InteropServices;

namespace Wuyin.ShoesManager
{
/// <summary>
/// VedioCapture 的摘要说明。
/// </summary>
public class VedioCapture
{
private int hCaptureM;
private bool isUnLoad = false;
public VedioCapture()
{
}
[DllImport("avicap32.dll")]
private static extern int capCreateCaptureWindow( string strWindowName, int dwStyle, int x, int y ,int width, int height , int hwdParent, int nID );
[DllImport("user32.dll")]
private static extern int SendMessage( int hwnd , int wMsg, int wParam , int lParam );
[DllImport("user32.dll")]
private static extern int SendMessage( int hwnd , int wMsg, int wParam , string lParam );
[DllImport("Kernel32.dll")]
private static extern bool CloseHandle( int hObject );
public bool Initialize( System.Windows.Forms.Control aContainer , int intWidth, int intHeight )
{
hCaptureM = capCreateCaptureWindow( "", 0x40000000 | 0x10000000, 0,0,intWidth,intHeight,aContainer.Handle.ToInt32() ,1 );
if( hCaptureM == 0 ) return false;

int ret = SendMessage( hCaptureM , 1034, 0,0 );
if( ret == 0 )
{
CloseHandle(hCaptureM);
return false;
}
//WM_CAP_SET_PREVIEW
ret = SendMessage( hCaptureM, 1074, 1, 0 );
if( ret == 0 )
{
this.UnLoad();
return false;
}
//WM_CAP_SET_SCALE
ret = SendMessage( hCaptureM, 1077, 1, 0 );
if( ret == 0 )
{
this.UnLoad();
return false;
}
//WM_CAP_SET_PREVIEWRATE
ret = SendMessage( hCaptureM, 1076, 66, 0 );
if( ret == 0 )
{
this.UnLoad();
return false;
}
return true;
}

public void SingleFrameBegin()
{
//
int ret = SendMessage( hCaptureM, 1094 , 0, 0 );
}
public void SingleFrameEnd()
{
//
int ret = SendMessage( hCaptureM, 1095 , 0, 0 );
}

public void SingleFrameMode()
{
//WM_CAP_GRAB_FRAME
int ret = SendMessage( hCaptureM, 1084 , 0, 0 );
//WM_CAP_SET_PREVIEW
//int ret = SendMessage( hCaptureM, 1074 , 0, 0 );
//WM_CAP_SINGLE_FRAME
//ret = SendMessage( hCaptureM, 1096 , 0, 0 );
}
public void PreviewMode()
{
int ret = SendMessage( hCaptureM, 1074 , 1, 0 );
}

public void UnLoad()
{
int ret = SendMessage( hCaptureM, 1035, 0, 0 );
CloseHandle( this.hCaptureM );
isUnLoad = true;
}

public void CopyToClipBorad()
{
int ret = SendMessage( hCaptureM, 1054, 0, 0 );
}

public void ShowFormatDialog()
{
int ret = SendMessage( hCaptureM, 1065, 0, 0 );
}
public void SaveToDIB( string fileName )
{
int ret = SendMessage( hCaptureM, 1049, 0, fileName );
}

public void ShowDisplayDialog()
{
int ret = SendMessage( hCaptureM, 1067, 0, 0 );
}
public System.Drawing.Image getCaptureImage()
{
System.Windows.Forms.IDataObject iData = System.Windows.Forms.Clipboard.GetDataObject();
System.Drawing.Image retImage = null;
if( iData != null )
{
if( iData.GetDataPresent( System.Windows.Forms.DataFormats.Bitmap ) )
{
retImage = (System.Drawing.Image)iData.GetData( System.Windows.Forms.DataFormats.Bitmap );
}
else if( iData.GetDataPresent( System.Windows.Forms.DataFormats.Dib ) )
{
retImage = (System.Drawing.Image)iData.GetData( System.Windows.Forms.DataFormats.Dib );
}
}
return retImage;
}

~VedioCapture()
{
if( !isUnLoad )
{
this.UnLoad();
}
}
}
}
先Initialize
然后display

膜拜。。 --------------------编程问答--------------------
引用 10 楼 liguangmin2009 的回复:
楼主啊   就我在给你忙活 搜源码 搜资料  记得多给我点分啊

分没问题啊,关键是我急着要解决问题啊 --------------------编程问答--------------------
网上 搜的   --------------------编程问答--------------------
引用 13 楼 liguangmin2009 的回复:
网上 搜的

也谢了 --------------------编程问答-------------------- 对了摄像头不是QQ开视频聊天的那种个人摄像头哦,是像小区监控系统的那种(二者到底有没区别,个人也不是很清楚) --------------------编程问答-------------------- 感觉楼主的需求不是很明确,望详细说明楼主的需求!
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,