Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Canada
Asked — Edited

Has Anyone Connected To Camera Using Visual Basic?

I was wondering if anyone has connected to the video camera using ez_B.dll from visual basic? I'd like to see a tutorial using the same method as was used in the tutorial for connecting to the servo via ez_B and Visual Basic.




Also, was wondering if anyone has tried to build a .BAS (visual basic module) for the ez_B functions so that the functions can be called from old versions of basic such as VB6?

Canada
#2  
Started New Project: Visual Studio Pro 2012: windows form application


1: I set the CPU to x86 (BUILD..configuration_manager.)
2: Added EZB.DLL
3: added 3 combo boxes,2 timers to form1
4:added ALL of the EZB controls to the form,including videoplayer
Getting a bunch of errors..and mytoolbar disapeared


ERROR in following line of code:
5:_camera = New Camera(EzB_Connect1.EZB) ' _camera = New Camera(EzB_Connect1.EZB)




Error 1 Argument not specified for parameter 'captureHeight' of 'Public Sub New(ezb As EZ_B.EZB, captureWidth As Integer, captureHeight As Integer)'. C:\Users\ANDY\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 13 19 WindowsApplication1

Error 2 Argument not specified for parameter 'captureWidth' of 'Public Sub New(ezb As EZ_B.EZB, captureWidth As Integer, captureHeight As Integer)'. C:\Users\ANDY\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 13 19 WindowsApplication1

Error 3 Line continuation character '_' must be preceded by at least one white space and must be the last character on the line. C:\Users\ANDY\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 16 69 WindowsApplication1

Error 4 'panel1' is not declared. It may be inaccessible due to its protection level. C:\Users\ANDY\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 33 53 WindowsApplication1

Error 5 'panel2' is not declared. It may be inaccessible due to its protection level. C:\Users\ANDY\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 33 61 WindowsApplication1
PRO
Synthiam
#3  
Please re-read my message. Download the VB example here: VB Tutorial 03 Camera

For more information on using Visual Basic, check for online tutorials and classes. You may also check your local schools for night courses on introduction to programming.

My suggestion is to use ARC, then you can migrate to Visual Studio development. By then, you will probably wish to use C# because it is much easier than Visual Basic actually:)
Canada
#4  
Hi DJ. Thanks for the speedy reply.
I already am using ARC, I recently purchased VS 2012. I used to do a lot of VB6 enterprise programming using the API.(hobby) Did a lot of winsockDLL programming and also using ip/worksV4 which are activeX controls that will let you build a TCP/ip server(daemon)((up to 1000 connections) in about 30 mins. in VB and a tcp/ip client in 10 mins

I also used wsock.bas in my vb programs...

I'm planning of learning VB.net and then go on the VC#. I'm able to add all of the ip/works DLL's to VB2012 including Telnet.ocx,daemon.tcpclient,ftpserver and client,udp etc...

So, I'm experimenting : got the VB servos going, want to get the vb camera going...then maybe GPS...but one thing at a time.

I'd also like to try and build an app using vb6 and EZB.bas.avicap32.dll.

I really like it if you could add a step by step tutorial for VB camera as you did with the VB servo control.(that was great.)

Thanks
PRO
Synthiam
#5  
Bobot, sounds great!

Again - I really need you to read my replies:) I have included a link twice to download an entire example VB Camera project.:) exactly what you're asking for
Canada
#6  
Here's what going on..

1: Created new project in VB2012(vs2012).Windows form application.
2:select x86 CPU from BUILD-configuarton manager
3.Add EZB to toolbox.


4:ADD all of the EZB controls to form1
5:ADD 3 combo boxes and 2 timer controls to form1


getting errors when I run the app or build.
Canada
#7  
The controls aren't being loaded into the application...probably because when I unzip the tutorial the application looks for them somewhere other than where I unzipped them..
Canada
#10  
TO SIMPLIFY:

These are the error msgs I get

Error 1 Argument not specified for parameter 'captureHeight' of 'Public Sub New(ezb As EZ_B.EZB, captureWidth As Integer, captureHeight As Integer)'.
Error 2 Argument not specified for parameter 'captureWidth' of 'Public Sub New(ezb As EZ_B.EZB, captureWidth As Integer, captureHeight As Integer)'.


when I run the following code.

_camera = New Camera(EzB_Connect1.EZB)
Canada
#11  
USING: Visual Studio Pro 2012,avicap32.dll,on windows 7 x64

Using the code found at:

http://www.devx.com/dotnet/Article/30375

I am able to get video from a wired video cam (NOT BLUETOOTH yet!).

If anyone wants to try the code and is having trouble, let me know and I'll give you the steps involved.


Still not able to get video using the EZB.DLL.
PRO
Synthiam
#12  
My suggestion is to take an online course on using VB and Visual Studio. First, follow the instructions in the Readme.txt file contained in the EZ-SDK ZIP File. Good luck:)

A book may help also - such as VB .Net for Dummies - which i know provide great instructions.
Canada
#13  
I just ordered a couple of books: vb2012 and another vs2012...

Figure I'll start with those and then move up to the dummy one:)
(I've got a bunch of Dummy books: there are great)


I've tried to follow the instructions...still didn't work...But I'll try it again...
Thanks
(will be changing my name to BOOBOOBOT soon!
PRO
Synthiam
#14  
Haha, do not fret:) If you follow the directions - it should be very easy.

1) Simply download EZ-SDK

2) Extract the contents of the file to your desktop, or somewhere common. Like My Documents

3) Follow the directions within the README file

- The README file instructions are important. They will direct you to ensure the project is configured for 32 bit (not 64). It will also explain that you will need to remove any broken references to EZ-B.DLL. A broken reference will display an icon.

- The README will also explain that you need to add a reference to the EZ-B.DLL.


User-inserted image


User-inserted image


User-inserted image
Canada
#16  
Great!

My screens are a little different but I think I checked everything...Had a ref to Forge.dll which i removed..
Runs with NO errors but still no camera...
I am able to connect to the EZ board...(on COM 9)
Canada
#18  
There isn't any camera showing up in the drop down.
I have the ez robot bluetooth and a usb wired logitech connected...
Before running the tutorial I checked and they both worked from ARC..
I ran the totorial and nothing shows up in the dropdown. I ran ez robot again and both are there and connect.
Canada
#19  
I tried the release,,,exe...it works...sees both cameras.
Canada
#20  
The following is part of my code that uses avicap32.dll

'The ListVideoSources() subroutine calls the capGetDriverDescriptionA() function and lists all the video sources in the ListBox control. Up to 10 video sources are supported:


'---list all the various video sources---
' Private Sub ListVideoSources()
' Dim DriverName As String = Space(80)
'Dim DriverVersion As String = Space(80)
' For i As Integer = 0 To 9
' If capGetDriverDescriptionA(i, DriverName, 80, _
' DriverVersion, 80) Then
'lstVideoSources.Items.Add(DriverName.Trim)
' End If
' Next
' End Sub

It first gets the drivernames using the dll


Then it adds them to the listbox...

I don't find the code in tutorial3 that gets the driver names....
#21  
Can you really send me the source code of the camera application you did cos it works very well..................i would love to learn this and apply it through during praticals...............thanks :)