adapting a webcam driver to an existing form
-
hi i'm new at c# and i'm using visual studio c# 2008 i have a very large application which needs to take pictures from a webcam to work with them i found this code (among many other which i haven't been able to get to work) http://www.c-sharpcorner.com/UploadFile/yougerthen/810262008070218AM/8.aspx[^] notice there, in the extra code the author asks to add for the thing to work, it has already a initializeComponent() since its a form of sorts. BUT notice too that MY application is also a form and pretty much larger, so of course it has its own initializeComponent() with near 150 other componets; the webcam stuff must be in one of the tabs initialized there. If i let the initializeComponent() be, the compiler says it does not exist in the actual context. i deleted the constructor altogether but then obviously not even the pictureBox appears. but then if i leave the constructor there, but remove the initializeComponent()... what should it had inside instead? the picture box and buttons are already taken care of in the bigger initializeComponent(). so how can i merge this code into mine so i can use the webcam features in there? any ideas?
-
hi i'm new at c# and i'm using visual studio c# 2008 i have a very large application which needs to take pictures from a webcam to work with them i found this code (among many other which i haven't been able to get to work) http://www.c-sharpcorner.com/UploadFile/yougerthen/810262008070218AM/8.aspx[^] notice there, in the extra code the author asks to add for the thing to work, it has already a initializeComponent() since its a form of sorts. BUT notice too that MY application is also a form and pretty much larger, so of course it has its own initializeComponent() with near 150 other componets; the webcam stuff must be in one of the tabs initialized there. If i let the initializeComponent() be, the compiler says it does not exist in the actual context. i deleted the constructor altogether but then obviously not even the pictureBox appears. but then if i leave the constructor there, but remove the initializeComponent()... what should it had inside instead? the picture box and buttons are already taken care of in the bigger initializeComponent(). so how can i merge this code into mine so i can use the webcam features in there? any ideas?
i can't download the code from your link. it has a problem. but here is some links which can help you: http://www.codeproject.com/KB/directx/PrgmngDirectShowappsCS.aspx[^] http://www.codeproject.com/KB/directx/directshownet.aspx[^] and the best resource for you is here : http://sourceforge.net/project/showfiles.php?group_id=136334[^] if you want to import codes from other projects to your project you shouldn't use their InitializeComponent() function. just add the necessary initialization codes after your InitializeComponent() function. like this :
public Form1()
{
InitializeComponent();
// add initialization codes here
// ...
}sometimes 0 can be 1
modified on Wednesday, March 25, 2009 9:26 AM