By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,081 Members | 1,342 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,081 IT Pros & Developers. It's quick & easy.

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

P: n/a
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],
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

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

Jun 8 '07 #1
Share this Question
Share on Google+
2 Replies

P: n/a
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...

Jun 8 '07 #2

P: n/a
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..

Jun 8 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.