Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi

I'm a beginner in WPF.

I just started capturing webcam in WPF. I recently did that with DirectX.Capture.dll in C#, but now I'm trying to do the same in WPF.

Here is my problem:
I added references as well, and I can start webcam (it's LED turns on which shows that it's working) but I don't know how to get a preview from webcam! Please help me about that.

Maybe it would make it clear if I mention that I used the following article for capturing Video in C#: DirectX.Capture Class Library[^]


Thanks in advance.
Posted
Updated 12-Mar-11 13:38pm
v3
Comments
Abdul Quader Mamun 12-Mar-11 18:47pm    
Edited spelling.

1 solution

I am not sure, from your question, if you are having problems in capturing the video, or just in displaying it.

If the problem is the display then there are two classes that may help you. MediaElement example :-A simple WPF media player with media item list[^] and MediaPlayer MSDN page[^].

If it is in capturing the video then you should not be confused by the fact that it is WPF. The process is the same as you have already done in C#. Always remember WPF stand for Windows Presentation Framework. It is about presenting stuff, not processing data. So most of the work in a WPF application will be done in the code behind.

Hope this helps.
 
Share this answer
 
Comments
zaeemi 13-Mar-11 6:25am    
thanks for your help buddy...
but let me say that yes... my problem is about displaying video.
you know, in C# i used a picturebox and wrote this : capture.previewwindow = picturebox1;
and this line of code did it for me, displaying the preview.
now, i didn't find a such a picturebox Component in WPF components,
maybe you laugh, but yohoo,,,, this is what i'm looking for! sth wich does the picturebox action.
i Also used a component named Image, and wrote this : capture.previewwindow = image.source;
but OOOOOPS! Didn't work!
Henry Minute 13-Mar-11 7:29am    
If you used a PictureBox in C# the nearest equivalent in WPF would be the Image control. MSDN page here --> http://msdn.microsoft.com/en-us/library/system.windows.controls.image.aspx.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900