how to use directx.capture in asp.net and c# code behind

P

pampululu

hello, I try to use directx.capture in my web application, I use
visual studio web developper 2005 express with c# for code behind.
I can list the webcam available on computer, no probem,
my probem is to capture and display webcam in a control
I tried like this:

protected void Page_Load(object sender, EventArgs e)
{
Filters filters = new Filters();
Capture capture = new Capture(filters.VideoInputDevices[0],
filters.AudioInputDevices[0]);
capture.VideoCompressor = filters.VideoCompressors[0];
capture.AudioCompressor = filters.AudioCompressors[0];

capture.FrameRate = 29.997; // NTSC
capture.FrameSize = new Size(640, 480); // 640x480
capture.AudioSamplingRate = 44100; // 44.1 kHz
capture.AudioSampleSize = 16; // 16-bit
//capture.AudioChannels = 1;

capture.PreviewWindow = PanelVideo;

PanelVideo is a System.Web.UI.WebControls.Panel

it doesnt work because capture.PreviewWindow want
System.windows.forms.control

I want when the user come on my webpage, he can see his webcam, take a
shoot and send it to someone,
someone has any idea?
thanks a lot
 
M

Marc Gravell

Page_Load runs at the server; you can't get hold of the client's
devices in this way; and likewise, you can't used managed directx from
clientscript (javascript/jscript etc).

I suspect you are developing with the web-server on your desktop
(perhaps via "cassini"), but this is not realistic. You'd need perhaps
some a smart-client to do this (i.e. an exe downloaded to the client
and executed locally) - but then you will run into trust issues.

Not a fix, but an explanation at least...

Marc
 
P

pampululu

yes I understand, you are right, I was thinking I successfully list
the device but it's because server and client on same machine.
thank you, but now it seems more complicated..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top