|
Hi, this is abu syed khan. For our project purpose we've built a robot. Plz visit www.thedailystar.net/magazine/2006/06/01/info.htm for more information. Now I want to improve its AI. I've two question.
1. How can I take pictures/capture video from a webcam for my program written in C#.
2. I want to write a program in c# that takes input from microphone and then give output through printer port. I can give output through a printer port. but the problem is I can n't take input in my program from a microphone. suppose if I say "one" in microphone then my program recognize the word and give output through printer port. I can give output but input is a problem for the time being.
Plz reply me. As far I know, I'm the first who is doing such project in Bangladesh. Waiting for ur reply.
001
|
|
|
|
|
Hi,
1. How can I take pictures/capture video from a webcam for my program written in C#.
> capturing from webcam on usb port is very easy with the OpenCV library. You can get the library from "http://sourceforge.net/projects/opencvlibrary/". You write 3-5 lines of code to get an image from webcam.
2) I want to write a program in c# that takes input from microphone
> Well, sound recording from microphone can be done with platform invoke using winmm.dll but there is a rather easy method : microsoft DirectX DirectSound. (i.e :using Microsoft.DirectX.DirectSound )
Regards
zafer
|
|
|
|
|
i am getting the following error while handling events in a client server remoting application
"Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level."
can any body help me out
thanks
hello
|
|
|
|
|
|
I need to be able to control the width of the tabs in TabControl.
Ofcourse that i can use the SizeMode.Fixed, However, i want to be able to set diffrent width to diffrent tabs.
Any help is appreciated
Tnx, Roy.
|
|
|
|
|
Hi,
I think you can't change the size of the tabs separately, because the tabs docking is fill, and they fill their container(tabcontrol)... As a alternative solution, you can handle which tab is selected and change the size of the tabcontrol...
|
|
|
|
|
Hi all,
I have a problem with the udpClient class. Here are the details.
I am creating an instance of udpClient class with the following constructer;
UdpClient myUdp = new UdpClient();
// I don't want to use the constructer "UdpClient myUdp = new UdpClient(localPortNo); "
So
1) what is the method that I should call to assign my listening port (local port number) for incoming udp packets?
2) How can unbind the port without deallocating all the sources related to the socket? i.e If I close my socket with the "close() " method than all the resources related to the socket are made free. Instead I just want to release the local port.
Best Regards
zafersavas
-- modified at 18:08 Saturday 24th February, 2007
|
|
|
|
|
You haven't said why you don't want to use the overloaded constructor to instanciate the client and specify the port.
The problem is that in order to listen for incoming data, you use the UdpClient.Receive method.
This method blocks until data is received, and with UDP being a connectionless protocol, you can never guarantee when data will be recieved so your left with having to listen for any/all incoming data over a specific port.
One way to achieve this is to run a UdpClient that listens for incoming data on a seperate thread which frees up the main thread to do it's normal work.
A seperate UdpClient can then be instanciated in the main thread whenever you need to send data.
I created a test project some time ago which you can download from here:
http://www.box.net/public/frq1a08ozh
It requires v2.0 of the .Net Framework but the source code should help point you in the right direction even if you using v1.1
Hope this helps
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
I made a Web User Control and it almost works how I want. I have a code behind setup on a web page. On the aspx page I have the custom control added and I can use the code from that page (ex. using my methods to setup the control). When I goto the code behind I don't know how to reference it so I can use its methods.
Thanks for the help.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
When you add your user control, you set it an id in the aspx, as in id="myControl". In the code behind, you can do myControl.XXXX to call methods on the control.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am actually making most of the code by hand, not using VS2005 to do the auto coding...
If I use VS2005 to auto code then it allows me to do it how you say. How do I do it by hand?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
All VS does is put a member variable with that name and type in your code behind. If you do that, the framework will attach it to the control in the aspx and you can do just what I said from there.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi All,
I definition of .NET FRAMEWORK - all class object ( except int, char and ext. ) are sending to function as reference.
So in witch case i need to use ref/out in declaration of function ?
Thanks for any help.
|
|
|
|
|
Yes class objects are sent by reference.
using the 'ref' keyword would just result in the exact same thing - namely sending the object by reference.
using the 'out' keyword on the other hand is for forcing the parameter into being set within the method. So if you made a virtual class or an interface with a member class referencing a parameter with the 'out' keyword, it would force any class inhereting your class / interface to set a value to the parameter. Failing to do so would result in a compilation error.
Hope that makes it a bit clearer.
-Larantz-
|
|
|
|
|
Larantz wrote: using the 'ref' keyword would just result in the exact same thing - namely sending the object by reference.
No, it doesn't result in the same thing. It results in the reference being send by reference. What is sent is a reference to the reference to the object.
---
single minded; short sighted; long gone;
|
|
|
|
|
All parameters are sent by value, unless you specify ref or out . For a reference type that means that the value of the reference is sent.
You would use ref or out if you need to change the actual reference of the object, not just the contents of the object.
You rarely ever need to use ref or out . It's used sometimes for performance reasons.
---
single minded; short sighted; long gone;
|
|
|
|
|
value types ( that is, int/double/etc ) are not passed by reference unless you use ref. out and ref do exactly the same thing in MSIL, the difference is, the compiler won't allow any execution paths where an out variable is not given a value.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
i am working in a parent child form environment.
i have a function in the Parent Form
publib void call_funct()
{
panel2.Visible=true;
}
now when i access this function from Child form, the code within the function is accessed(i've checked it through applying breakpoints), but there is no effect of the code.
what i mean is that panel2 doesn't become visible.
how do i correct this??
thanks for the time
Saira
|
|
|
|
|
If you have instanciated your panel2 within the parent form like:
MyChildFormClass panel2 = new MyChildFormClass();
then you'll make it show by calling the Show() method:
public void ShowChildForm()
{
panel2.Show();
}
but if it's a normal usercontrol like System.Windows.Forms.Panel then you'll
make it show by:
public void ShowPanel()
{
this.SuspendLayout();
panel2.Size = new Size(sizeX, sizeY);
panel2.Location = new Point(ptX, ptY);
this.Controls.Add(panel2);
this.ResumeLayout();
}
-Larantz-
|
|
|
|
|
ur code isn't woking for me.
anyway
thanks for ur time
Regards
Saira
|
|
|
|
|
publib ???
Is panel2 sitting inside another control that is not visible ? Is it within the visible area of the form ? How was it created ? Is it part of the forms controls collection ?
Saira Tanwir wrote: accessing control of one form from another form
You should never do this. If you want to change the behaviour of a control on another form, you should expose a property that sets what you want, such as
public PanelVisible
{
get { return panel2.Visible;}
set { panel2.Visible = value; }
}
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How to move an icon that is on the desktop at some position.
C#
|
|
|
|
|
Hi,
the easy way is using Windows desktop, i.e. interactively.
Programmatically it is a rather complex job.
It involves:
- finding the right window (the desktop icons are all inside a listview which you could access
on WinXP by finding first "Progman" then "SHELLDLL_DefView" then "SysListView32").
- finding the right icon (if you know it by name, you could enumerate them all to find its
index in the list.
- sending it an LVM_SETITEMPOSITION message using SendMessage
All of the above require calling win32 functions from user32.dll with PInvoke.
You'll have to do a lot of searching both on CodeProject and on MSDN and/or Google.
|
|
|
|
|
Hi,
I'm new in c#,
Ihava dummy question about how to termite button events.
Sample
If Usernam.text<>'' then
press "button" let me to next field
if username.text='' then
press button diable for nex field
tnx
Dani
|
|
|
|
|
You should make the buttonNext disabled as default.
Then in your textbox' "content changed" event method you could do something according to the following:
private void textboxUsername_ContentChanged(object sender, EventArgs e)
{
if(textboxUsername.Text.Equals(validUsername))
buttonNext.Enabled = true;
}
Hope it's of some help to you.
-Larantz-
|
|
|
|