|
|
hello guys,
I am a beginner.I am interesting in Aforge.net.It is a really fantanstic framework~!
I want to know how to use AForge.net in C# to connect to a Camera.I found the Motion_Detection article but it's too diffcult to me.I can not to understand it.~_~;
So what I want to know is just a very simple example to show how to connect to a camera and get a image from the camera. Thanks~!
I am really really really really eager to know the answer asap.
MSN:franva008@hotmail.com
now this is my code:
private void button1_Click(object sender, EventArgs e)
{
// enumerate video devices
AForge.Video.DirectShow.FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
// create video source
VideoCaptureDevice videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString);
//VideoCaptureDevice videoSource = new VideoCaptureDevice("Acer HD Crystal Eye webcam");
// set NewFrame event handler
videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
// start the video source
videoSource.DesiredFrameRate = 25;
videoSource.DesiredFrameSize = new Size(pictureBox1.Width, pictureBox1.Height);
videoSource.Start( );
}
private void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
// get new frame
//Bitmap bitmap = eventArgs.Frame;
pictureBox1.Image = (Image)((object)bitmap);
//pictureBox1.Image = (Image)eventArgs.Frame;
// process the frame
}
Error message:invalue Parameters
modified on Saturday, December 13, 2008 11:31 AM
|
|
|
|
|
HI,
In My application I need to retrive the excution file for a given mimetype.
i.e.
I have "Smaple.doc" So I retrive it's MimeType by "doc" extention and now I'm missing the way to
retrive the actual excution file of the mimeType (in this example it should be "winword.exe".
Any ideas on how to do so?
it doesn't have to be the same way I'm thinking of doing it, as long as the in string is a given file name ("xxx.doc") and out is the excution file ("winword.exe").
tnx
modified on Saturday, December 13, 2008 6:19 AM
|
|
|
|
|
Are you sure you need to know the exe?
if you execute Process.Start("xxx.doc") it will launch whatever exe is associated with the .doc extension (probably winword.exe), as if you double-clicked the file in Windows Explorer.
|
|
|
|
|
Hello,
As Luc has told you if the only thing you need is to launch the application associated with doc file, you can use Process class. On the other hand if you really need to retrieve application path then you will need to use various methods for reading windows registry as the information is stored in system registry.
|
|
|
|
|
Anyhow I found the answer my self already.
It's all in the registry.
in order to retrive which application is associated with the extention you need to access the OpenWithList key for the extention.
all the extentions are located under
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
there you can find your extention and all you need is to open the OpenWithList key
i.e.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.doc\OpenWithList
in this key you will find DWORD's a,b,c
each represent and application to use in order to open this file.
"a" is the default.
|
|
|
|
|
I want to store Controls(All Buttons) of my form in array list.Is it possible.
|
|
|
|
|
Use generic collection, it's better. But you can use ArrayList as well but remember that ArrayList stores type Object so when you are retrieving you have to cast them.
List list = new List();
|
|
|
|
|
Hi,
you can store anything you like in an ArrayList or any other kind of collection (Hashtable, SortedList, ...).
you can store all kinds of objects with a common base type (such as Control) in a List of that type, or any other kind of collection capable of holding your base type (Dictionary, ...).
You probably don't have to create a new collection since each Control (and hence each Form) already has a collection holding ALL its Controls.
Example: if you want to do something to all the Buttons on myForm, this would be sufficient:
foreach(Control c in myForm.Controls) {
Button btn=c as Button;
if (btn!=null) {
btn.PerformClick();
}
}
Warning: a foreach on an enumerator will not allow you to modify the collection, so the above loop would not allow you to add or remove buttons; you would need a for or while loop for that.
|
|
|
|
|
|
Don't forget that the form also may have containers (panels, group boxes etc) which may have buttons in them. You will need a recursive structure to get ALL the buttons on a form.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Its better if you use Hashtable cause here in key you can also save the ID of that button.
Cheers!!
Brij
|
|
|
|
|
or Dictionary<t,t>, to make use of generics
Regards,
Lev
|
|
|
|
|
You don't need to do that because the Name property is the ID. Since it's already in the control, no need to store it outside of its current context.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
They're already in a list (look at the controls property). Don't forget that a container control (like a panel or group box) will probably have child controls, and will therefore have their own list. It's like a singly linked list.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi, we are doing a project using C# and would like to release it as an OpenSource software. However, we are using a few DLL files which ofcourse we have made and are willing to share the source code for further development. Under such circumstances, is it violating the Open Source license?
Thanks,
Abhishek.
|
|
|
|
|
If its your code, then you can't break your own license If you want to share the source for them as well, go for it.
It also depends on what Open Source license you choose. Have a read on wikipedia about what license is suitable for your goals.
|
|
|
|
|
I prefer to get DLLs along with the source code.
I think an open-source project should allow people to read and compile the code, but not require them to.
I don't like having to build other peoples' code, though at least it's easier with .net (due to limited operating system and compiler support ).
One of my worst experiences was trying to build an OpenVMS version of a Perl module (a driver for RDB); I never got it to compile.
My best experience was compiling the MySQL ADO.net connector, the only problem is all the warnings about Obsolete methods.
|
|
|
|
|
Hello
I want create a file fox (*.dbf) which has 3 fields (ID, NAME, MOBILE). Then I need insert data to this file. Example:
1, Mr Join, 0912555666
2, Ms Angela, 0123666777
----------------------------------------
You can help me? There are examples as possible. Thank you very much!
|
|
|
|
|
No idea what you are asking. Please clarify.
|
|
|
|
|
Why DBF, this format is no longer used in any applications that I know of (possible exception is Foxpro). I suggest you look into another database, Access or SQL Express and there are a couple of others out there that will be a better option than DBF.
You cannot "write" to a .DBF file using filestream, you have to create a connection to the file, you may be able to use the Jet engine, try connectionstrings.com
You could also use XML for small data sets.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How can I print content of richtextBox in C# ?
Hello Friends
|
|
|
|
|
|
is there any easier way to do it
or
can we do it through another control
Hello Friends
|
|
|
|
|
well it is pretty easy by itself just dig into the sample code
Regards,
Lev
|
|
|
|