|
Hi guyz, I'm developing a small experimental application for myself...and I want to implement some motion detection algorithms.
However, I want to take the input from a webcam. Therefore my question is:
How do you use a webcam through C#??
Any help is highly appreciated (even a web tutorial would be a nice suggestion!)
ThankS
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
|
10Q for your help!
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
|
10q for your help!
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
I have readed this article:
http://www.codeproject.com/cs/miscctrl/AlphaBlendTextBox.asp
it allow to download a dll to implement the custom textbox.
How can i use that dll in my project?
Thanks
|
|
|
|
|
add arefernce to it in your soulution explorer //if you are using VS.NET.
|
|
|
|
|
can you tell me how? i'm newbie
|
|
|
|
|
In the solution explorer ,you will find icon called reference ,right click it ,and then click add reference and then browse to your dll .
|
|
|
|
|
ok i've done thanks, but now to use that object inside my form ho can i do?
|
|
|
|
|
i mean to see it in the toolbar, so i can drag in my form when i want how can i do?
|
|
|
|
|
If you were pointing at this from the beginning you wouldn't have the dll added to your project.
Just right click the toolbar and then choose Add/Remove items Link and click on it ,and then browse to your dll and every control contained in it will be added to the toolbox and then by only dragging it to your form the reference to this dll will be added automatically .
|
|
|
|
|
Yet again I am stuck. I've followed many code examples, most of which are wholly different and do not explain the small details I am lacking in my implementation. Basically what has happened is that, using the Async message sending I have implemented, the messages run together and mix data, which is obviously no good. I assumed that the Async BeginSend took care of this, but I guess I was wrong, either that or I did it wrong. The code below is my basic implementation:
<br />
public void SendMessage(String msg) <br />
{<br />
try<br />
{<br />
if(m_sndCallBack == null) <br />
{<br />
m_sndCallBack = new AsyncCallback(OnDataSent);<br />
}<br />
SocketPacket packet = new SocketPacket();<br />
packet.thisSocket = m_clientSocket;<br />
<br />
packet.dataBuffer = Encoding.UTF8.GetBytes(msg);<br />
<br />
m_clientSocket.BeginSend(packet.dataBuffer,<br />
0, packet.dataBuffer.Length,<br />
SocketFlags.None, <br />
m_sndCallBack, <br />
packet);<br />
}<br />
catch(SocketException se)<br />
{<br />
Debug.WriteLine(se.Message);<br />
} <br />
}<br />
public void OnDataSent(IAsyncResult asyn)<br />
{<br />
SocketPacket theSockId = (SocketPacket)asyn.AsyncState;<br />
try<br />
{<br />
int iRx = theSockId.thisSocket.EndSend (asyn);<br />
theSockId.thisSocket = null;<br />
}<br />
catch (ObjectDisposedException )<br />
{<br />
Debug.WriteLine("Web.OnDataReceived: Socket has been closed");<br />
}<br />
catch(SocketException se)<br />
{<br />
Debug.WriteLine("Web.OnDataReceived: "+se.Message);<br />
}<br />
}<br />
Now my typical calling, which may be the problem? would be:
ClientServer.SendMessage("CONNECT:username:password");
...
ClientServer.SendMessage("REQUEST:STATUS");
ClientServer.SendMessage("REQUEST:LIST");
and the server receives:
CONNECT:username:passwordREQUEST:STATUS...
Am I supposed to be waiting on the data to be sent? And if so, should I not even implement the sending using Async code? Any help would be greatly appreciated.
|
|
|
|
|
If your protocol demands that messages must be sent in a particular order, then you shouldn't use BeginSend. Each BeginSend will use a threadpool thread to run, so there is no guarantee as to the order in which the messages will actually be sent.
Waiting till the callback completes before sending the next message will solve your problem.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Where would the best place to implement the wait be?
If only I could find GOOD async code to model my implementation hah...
I am contemplating just writing synchronously and reading asynchronously because it doesnt really matter what order the messsages are received just that they are a single message.
Thanks
|
|
|
|
|
Is it OK if the server receives message like
REQUEST:STATUSCONNECT:username:password... ??
That's what I meant by the ordering problem, your messages themselves could get mixed up.
I'd typically implement this by creating my own thread and running a queue system there. All messages to be sent are posted to the queue and the queue synchronously processes them.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks, works beautifully, I figured the problem was the Async sending but I wasn't sure.
|
|
|
|
|
who's use powerbuilder tool or have ebook ! please help me.
thank you very much.
|
|
|
|
|
Hi folks,
I want to write a piece of code to check if a domain user is member of a local group in my machine. I've read some articles but I don't think I can use LDAP here.
Could you guys give me a hint?
Thanks a bunch.
|
|
|
|
|
Hi,
I'm trying to write an Out of proc DCOM server in C#. I have the Server written, its now a COM object so thats done.
Where i'm stuck is this. As far as I kmow, DCOM works by having a stub object on the machine that the server is running on, and then a proxy on each of the client machines that communicates with the stub object.
How are the stub and proxy objects created? I'm told that in C++, they are created automatically but I am developing this in C# so I need to know if it works the same. The client is written in C++ and the DCOM server is written in C#.
Any help or comments will be appreciated
Thanks
Millzy
|
|
|
|
|
hi to all of you, i'm developing a voice over IP application
i need it for a web page also
i studied the directX to include directX sound i suppose
i need it but that didn't work on asp.net
all i found over the internet is applications made in c++
i needed for .net languages so i have 2 questions :
1- is directX Applicable in web pages
2- the way to develop a library of my own what do need to code in this library so i can used it as a component
i really do need help about this cause i found such components on the internet but are not for free
and if i buy it i don't suppose they send me the source code
so for all the experienced out there DO YOU HAVE THE SOLUTION i need HELP
send me mail to charbel_zibara@hotmail.com
|
|
|
|
|
ASP.NET is a server-side only technology that generated HTML pages for a client. You cannot use DirectX in an ASP.NET app. Since a web page cannot access hardware on the client computer, you'll have to develop a control that the client will have to install to do VoIP. No, I don't have ANY code to do this, nor do I have any source of information on it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How could I change the format of the DateTime ?
The local Date is in the "dd-mm-yyyy" but SqlDbType is in "mm-dd-yyyy" format .
Thanks in advance.
|
|
|
|
|
We use
time.ToString("G", DateTimeFormatInfo.InvariantInfo);
and you should also consider using
time.ToUniversalTime();
before storing times in the database, to avoid problems with daylight saving.
|
|
|
|
|
If you want to store a date in SQL server, use parametized queeries, and that'll solve the problem, in any format SQL Server uses.
DateTime myDateTime = .....
string sql = "UPDATE People SET BirthDate = @Date WHERE ID_person = 1";
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.Add("@Date", myDateTime);
cmd.ExecuteNonQuery(); That will save the correct date, no matter what format is the local computer, and/or SQL Server's computer using.
Alternatively, there's a way to change the date format for SQL Server, but I don't remember the exact syntax. Using parametized queries, I don't need it.
Also, parametized queries help avoid SQL injection attacks, so I'll recommend them for every circumstance.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|