求asp.net 在线拍照片的方案(帮顶散分) 看了很多资料,我认为flase拍后转为c#处理是比较适合我的,可是我flash一窍不通,求一个在线拍照的完整方案,包括拍照的flash和处理的asp.net.或者提供线索,哪儿有拍照的flase,感谢大家!!!鞠躬. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 QQ空间就有这种功能,可以操作摄像头,虽然我对QQ这个东西十分反感,但是这功能还是可以借鉴下的 客户端嵌入Activex操作摄相头的c#代码codeproject上有 操作 摄像头 这个应该是要做activex的.activex获取摄像头 数据后在回传给你的 服务器段C#来处理吧 不是有个FLASH组件吗直接就可以用的~! .net的winForm还是可以的,但是Webform就会有很多问题,要是想访问服务器上的摄像头还应该可以,但是客户端的好象就不行了~目前这类问题一般都是通过ActiveX来解决的 感觉现在大家都在想让 .net 实现一切我们能想到的功能才发现.net原来如此高深阿~关注该帖 静牛人来 没有做过这方面的应用感觉似乎要通过ActiveX实现吧 flash 的那个flash com服务器不太好用 先用flash把拍照得做好,嵌入到网页中.flash拍照的代码网上很多的,搜索就能找到.在服务器装个flash media server. 感谢大家的支持,我现在查看到的资料,使用flash和asp.net交互应该可以实现我要的功能.关于flash和asp.net交互的功能谁能多介绍一点. flash和.net交互网上也很多,讲的也很详细,总得有四种:LoadVars,JS,xml,remoting http://www.klstudio.com/post/49.html以前查的资料,应该有用 flash操作这个很容易flash+fms.拍照后回传.net一个图片名字就行了。 flash media server 然后.net主要是用于保存这些图片路径就可以了 问题:我用了虑拟机运行时提示少了"Base01.vhd "文件,我下的vs2007没有这个文件的啊,请问这个是什么?那个有的给个下载地址,谢谢.装了几天了,还没有搞完它. flash + WebService 可以解决问题! 我在上家公司是专门做视频的,这里是用flash,你可以看下Flash Comm Server 2.0方面的资料,国外有开源代码 activeX 的应用大家有介绍的么? 我这几天到我们这里的图书城 看到了 .NET FrameWork For Flash 你可以买来看看 要不你就== =到 正式版的2007出来 听出.net3.0里面的新的API 会彻底改变Flash的流行的趋势====吧 using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using System.Runtime.InteropServices;using System.Drawing.Imaging;namespace CapTureMovie{/// <summary>/// Form1 的摘要说明。/// </summary>public class Form1 : System.Windows.Forms.Form{private System.Windows.Forms.Button BtnCapTure;private System.Windows.Forms.Panel panel_Vedio;private int hHwnd;private System.Windows.Forms.Button BtnStop;private System.Windows.Forms.Label LbSysMsg;private System.Windows.Forms.Button button1;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;}public delegate bool CallBack(int hwnd, int lParam);/// <summary>/// 必需的设计器变量。/// </summary>private System.ComponentModel.Container components = null;[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);public Form1(){//// Windows 窗体设计器支持所必需的//InitializeComponent();//// TODO: 在 InitializeComponent 调用后添加任何构造函数代码//}/// <summary>/// 清理所有正在使用的资源。/// </summary>protected override void Dispose( bool disposing ){if( disposing ){if (components != null){components.Dispose();}}base.Dispose( disposing );} #region Windows 窗体设计器生成的代码/// <summary>/// 设计器支持所需的方法 - 不要使用代码编辑器修改/// 此方法的内容。/// </summary>private void InitializeComponent(){System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));this.panel_Vedio = new System.Windows.Forms.Panel();this.BtnCapTure = new System.Windows.Forms.Button();this.BtnStop = new System.Windows.Forms.Button();this.LbSysMsg = new System.Windows.Forms.Label();this.button1 = new System.Windows.Forms.Button();this.SuspendLayout();//// panel_Vedio//this.panel_Vedio.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Vedio.BackgroundImage")));this.panel_Vedio.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;this.panel_Vedio.Location = new System.Drawing.Point(8, 16);this.panel_Vedio.Name = "panel_Vedio";this.panel_Vedio.Size = new System.Drawing.Size(288, 224);this.panel_Vedio.TabIndex = 0;//// BtnCapTure//this.BtnCapTure.Location = new System.Drawing.Point(24, 256);this.BtnCapTure.Name = "BtnCapTure";this.BtnCapTure.TabIndex = 1;this.BtnCapTure.Text = "图象采集";this.BtnCapTure.Click += new System.EventHandler(this.BtnCapTure_Click);//// BtnStop//this.BtnStop.Enabled = false;this.BtnStop.Location = new System.Drawing.Point(136, 256);this.BtnStop.Name = "BtnStop";this.BtnStop.TabIndex = 1;this.BtnStop.Text = "停止采集";this.BtnStop.Click += new System.EventHandler(this.BtnStop_Click);//// LbSysMsg//this.LbSysMsg.Location = new System.Drawing.Point(16, 296);this.LbSysMsg.Name = "LbSysMsg";this.LbSysMsg.Size = new System.Drawing.Size(240, 23);this.LbSysMsg.TabIndex = 2;//// button1//this.button1.Location = new System.Drawing.Point(304, 48);this.button1.Name = "button1";this.button1.TabIndex = 3;this.button1.Text = "button1";this.button1.Click += new System.EventHandler(this.button1_Click);//// Form1//this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);this.ClientSize = new System.Drawing.Size(400, 357);this.Controls.Add(this.button1);this.Controls.Add(this.LbSysMsg);this.Controls.Add(this.BtnCapTure);this.Controls.Add(this.panel_Vedio);this.Controls.Add(this.BtnStop);this.Name = "Form1";this.Text = "Form1";this.ResumeLayout(false); }#endregion/// <summary>/// 应用程序的主入口点。/// </summary>[STAThread]static void Main(){Application.Run(new Form1());}private void BtnCapTure_Click(object sender, System.EventArgs e){this.OpenCapture();}private void OpenCapture(){int intWidth=this.panel_Vedio.Width;int intHeight=this.panel_Vedio.Height;int intDevice=0;string refDevice=intDevice.ToString();hHwnd=Form1.capCreateCaptureWindowA(ref refDevice,1342177280,0,0,640,480,this.panel_Vedio.Handle.ToInt32(),0);this.LbSysMsg.Text="";this.LbSysMsg.Text+="驱动:"+refDevice;if(Form1.SendMessage(hHwnd,0x40a,intDevice,0)>0){Form1.SendMessage(this.hHwnd,0x435,-1, 0);Form1.SendMessage(this.hHwnd,0x434,0x42, 0);Form1.SendMessage(this.hHwnd,0x432,-1, 0);Form1.SetWindowPos(this.hHwnd,1,0,0,intWidth,intHeight,6);this.BtnCapTure.Enabled=false;this.BtnStop.Enabled=true;}else{Form1.DestroyWindow(this.hHwnd);this.BtnCapTure.Enabled=false;this.BtnStop.Enabled=true;}}private void BtnStop_Click(object sender, System.EventArgs e){Form1.SendMessage(this.hHwnd, 0x40b, 0, 0);Form1.DestroyWindow(this.hHwnd);this.BtnCapTure.Enabled=true;this.BtnStop.Enabled=false;}private void button1_Click(object sender, System.EventArgs e){try{Form1.SendMessage(this.hHwnd,0x41e,0,0);IDataObject obj1 = Clipboard.GetDataObject();if (obj1.GetDataPresent(typeof(Bitmap))){Image image1 = (Image) obj1.GetData(typeof(Bitmap));// this.panel_Vedio.Image = image1;// this.ClosePreviewWindow();SaveFileDialog SaveFileDialog1=new SaveFileDialog();if (SaveFileDialog1.ShowDialog() == DialogResult.OK){image1.Save(SaveFileDialog1.FileName, ImageFormat.Bmp);}}}catch{}}}} [email protected],也发一个给我吧谢谢 [email protected]我也要份,谢谢 存诸过程方面的疑问? 请问,asp.net如何调用服务器上的某个指定Windows计划任务? 有每有生成16位随机字串的现成函数?? .aspx的前台文件获取数据库外键问题!请高手来!!!!!给分!在线等!!! 问个比较菜的问题:Response类为什么不能继承? DATAGRIDE输出EXCEL的奇怪问题 通过机器刷会员卡后,如何把卡信息发送到指定服务器? WebService为什么是无连接状态? 各位谁有用OleDb存取access2000的例子,请给小弟发一份 用户控件的问题,急!在线等待。。。。 怎样替换掉文本框中指定内容? 为什么e.Item.Cells[n].Text取不到值
操作摄相头的c#代码codeproject上有
activex获取摄像头 数据后在回传给你的 服务器段C#来处理吧
直接就可以用的~!
才发现.net原来如此高深阿~
关注该帖 静牛人来
感觉似乎要通过ActiveX实现吧
以前查的资料,应该有用
flash+fms.拍照后回传.net一个图片名字就行了。
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
using System.Drawing.Imaging;namespace CapTureMovie
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button BtnCapTure;
private System.Windows.Forms.Panel panel_Vedio;
private int hHwnd;
private System.Windows.Forms.Button BtnStop;
private System.Windows.Forms.Label LbSysMsg;
private System.Windows.Forms.Button button1;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;}
public delegate bool CallBack(int hwnd, int lParam);
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
[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);public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.panel_Vedio = new System.Windows.Forms.Panel();
this.BtnCapTure = new System.Windows.Forms.Button();
this.BtnStop = new System.Windows.Forms.Button();
this.LbSysMsg = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panel_Vedio
//
this.panel_Vedio.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Vedio.BackgroundImage")));
this.panel_Vedio.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel_Vedio.Location = new System.Drawing.Point(8, 16);
this.panel_Vedio.Name = "panel_Vedio";
this.panel_Vedio.Size = new System.Drawing.Size(288, 224);
this.panel_Vedio.TabIndex = 0;
//
// BtnCapTure
//
this.BtnCapTure.Location = new System.Drawing.Point(24, 256);
this.BtnCapTure.Name = "BtnCapTure";
this.BtnCapTure.TabIndex = 1;
this.BtnCapTure.Text = "图象采集";
this.BtnCapTure.Click += new System.EventHandler(this.BtnCapTure_Click);
//
// BtnStop
//
this.BtnStop.Enabled = false;
this.BtnStop.Location = new System.Drawing.Point(136, 256);
this.BtnStop.Name = "BtnStop";
this.BtnStop.TabIndex = 1;
this.BtnStop.Text = "停止采集";
this.BtnStop.Click += new System.EventHandler(this.BtnStop_Click);
//
// LbSysMsg
//
this.LbSysMsg.Location = new System.Drawing.Point(16, 296);
this.LbSysMsg.Name = "LbSysMsg";
this.LbSysMsg.Size = new System.Drawing.Size(240, 23);
this.LbSysMsg.TabIndex = 2;
//
// button1
//
this.button1.Location = new System.Drawing.Point(304, 48);
this.button1.Name = "button1";
this.button1.TabIndex = 3;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(400, 357);
this.Controls.Add(this.button1);
this.Controls.Add(this.LbSysMsg);
this.Controls.Add(this.BtnCapTure);
this.Controls.Add(this.panel_Vedio);
this.Controls.Add(this.BtnStop);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}private void BtnCapTure_Click(object sender, System.EventArgs e)
{
this.OpenCapture();}
private void OpenCapture()
{int intWidth=this.panel_Vedio.Width;
int intHeight=this.panel_Vedio.Height;
int intDevice=0;
string refDevice=intDevice.ToString();
hHwnd=Form1.capCreateCaptureWindowA(ref refDevice,1342177280,0,0,640,480,this.panel_Vedio.Handle.ToInt32(),0);
this.LbSysMsg.Text="";
this.LbSysMsg.Text+="驱动:"+refDevice;
if(Form1.SendMessage(hHwnd,0x40a,intDevice,0)>0)
{
Form1.SendMessage(this.hHwnd,0x435,-1, 0);
Form1.SendMessage(this.hHwnd,0x434,0x42, 0);
Form1.SendMessage(this.hHwnd,0x432,-1, 0);
Form1.SetWindowPos(this.hHwnd,1,0,0,intWidth,intHeight,6);
this.BtnCapTure.Enabled=false;
this.BtnStop.Enabled=true;
}
else
{
Form1.DestroyWindow(this.hHwnd);
this.BtnCapTure.Enabled=false;
this.BtnStop.Enabled=true;
}
}private void BtnStop_Click(object sender, System.EventArgs e)
{
Form1.SendMessage(this.hHwnd, 0x40b, 0, 0);
Form1.DestroyWindow(this.hHwnd);
this.BtnCapTure.Enabled=true;
this.BtnStop.Enabled=false;
}private void button1_Click(object sender, System.EventArgs e)
{
try
{
Form1.SendMessage(this.hHwnd,0x41e,0,0);
IDataObject obj1 = Clipboard.GetDataObject();
if (obj1.GetDataPresent(typeof(Bitmap)))
{
Image image1 = (Image) obj1.GetData(typeof(Bitmap));
// this.panel_Vedio.Image = image1;
// this.ClosePreviewWindow();SaveFileDialog SaveFileDialog1=new SaveFileDialog();
if (SaveFileDialog1.ShowDialog() == DialogResult.OK)
{
image1.Save(SaveFileDialog1.FileName, ImageFormat.Bmp);
}
}
}
catch
{
}
}
}
}
谢谢