|
||||||
| Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hi..
Attached is a code to capture a USB webcam. If i want to use the code as a server, what do i need to add to it..? Preferably, sending using UDP.. can somebody please advise.. After that, I want to write a client program.. but that is later.. By the way, I am new to Visual Basic, so, help is needed and appreciated. Thanks.. |
| Sponsored Links |
|
|
|
|||||
|
Lop, that looks like C# code instead of VB.
MrNobody, I've copied your post into the code section, I hope this is alright. http://forum.codecall.net/tutorials-...sb-camera.html
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||
|
Lop:
Thanks for the reply and the code... I am using VB 6.0. Here are a few things i need help with.. 1) How do I convert the VB 6 code into VB.net..? 2) How do i change the code to make it UDP instead of TCP, because i need a fast transmission.. I don't mind loosing a few frames.. 3) Can I compile the code as it is or do I need to add something else to it..? 4) How do I create a server with the webcam code added to it..? Honestly, this is the first VB 6 program i compiled... So, sorry if i ask silly questions... Jordan: Sure u can put the code in the code section.. I don't mind.. |
|
|||||
|
This code is ready to be compiled and ran:
http://forum.codecall.net/tutorials-...er-client.html Just download the attachment. 1) For converting to .NET - that is harder than said. 2) Wherever you see TcpClient use System.Net.Sockets.UdpClient or just UdpClient if you have that namespace decalred. 3) Yes, if you download the attachment 4) You will need to rewrite this in .NET if you choose to use that. I suggest you create it in .NET because I couldn't find anything on vb 6 and TCP. Here is a tutorial: http://www.codeproject.com/vb/net/TinyUDP.asp
__________________
Lop |
| Sponsored Links |
|
|
|
|||
|
Lop:
I went to:- http://forum.codecall.net/tutorials-...er-client.html But there it said:- "This is the client, which is not in C++ but C# .NET 2.0 for" Is C#.Net the same as VB.net..? I am very new to .Net... |
|
|||||
|
No, C# is not the same as VB but when using the .NET language it is very easy to port. VB and C# have all of the same classes, methods, functions, and namespaces so you just need to change the way the code is called.
I don't know VB that well so I can't give an example. Sorry.
__________________
Lop |
|
|||
|
Hi.. I managed to find a simple client/server using UDP in VB 6.0 to send message..
Below is the code.. The code is taken from http://homepages.ius.edu/RWISMAN/B43...ram%20Services I just change the form caption only.. Does anybody know how I can edit both the code so that I can send Webcam Stream from server to client instead of sending messages..? Thanks.. Lop: I tried those C# to VB.net converter tools to convert the code but it does not work.. Maybe its because of different version of VB.net.. I am using VB Express 2005.. its ok.. thanks anyway.. |
|
|||
|
I didn't even know there was a C# to VB.net converter!
I can't see the code because I don't have VB 6. Can you post the section for sending messages? It would probably be a simple matter of adding a loop and streaming the media.
__________________
DirkFirst |
|
|||
|
Quote:
I am not sure if it works tho... Anyway, I have found a code for the client/server that capture and transmit webcam stream. I have attached it below for those who are interested in doing it.. The code uses the code below to capture and send the stream Code:
Private Sub TmrStream_Timer() On Error Resume Next TakeFrame End Sub Public Sub TakeFrame() On Error Resume Next Dim Bjpg As String If Winsock1.State = sckConnected Then SavePicture Picture1.Picture, App.Path & "\temp.bsrm" Call ConvertBMPtoJPG(App.Path & "\temp.bsrm", App.Path & "\temp.jsrm", True, 100, False) DoEvents Bjpg = GetFile(App.Path & "\temp.jsrm") DoEvents Winsock1.SendData Bjpg End If End Sub I came across other methods such as using DirectShow and AVICap.. Why different methods of doing similar tasks..? Which is the more effective way..? |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Access server file from client | ahpooh | Visual Basic Programming | 1 | 09-06-2007 02:36 PM |
| Delphi Sockets : Simple client and server program | tosh5457 | Pascal/Delphi | 0 | 05-26-2007 12:00 PM |
| Access server file from Client | ahpooh | Visual Basic Programming | 2 | 02-14-2007 07:51 PM |
| AOL opens video search engine to developers | Lop | General Programming | 0 | 09-19-2006 02:26 PM |
| Server side and client side | Kaabi | PHP Forum | 6 | 07-30-2006 11:19 AM |
| WingedPanther | ........ | 2662.49 |
| Xav | ........ | 2581.51 |
| Brandon W | ........ | 1698.26 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 959.05 |
| dcs | ........ | 646.09 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 409.29 |
| chili5 | ........ | 380.6 |
Goal: 100,000 Posts
Complete: 97%