Check camera devices available in Add-in?
Dear All,
In Project Workbench, I can use 'ThisApplication.Capture.Devices.Count' to get device count.
Using 'ThisApplication.Capture.ActiveDevice.DevName' to get current device name.
But those command isn't support in Add-in Project.
How do I know if there are any camera devices available?
In Project Workbench, I can use 'ThisApplication.Capture.Devices.Count' to get device count.
Using 'ThisApplication.Capture.ActiveDevice.DevName' to get current device name.
But those command isn't support in Add-in Project.
How do I know if there are any camera devices available?
0
Best Answer
-
My mistake, I missed putting the line to run the command to retrieve the value. Please try the following code:Dim DeviceCount As Integer = 0With MediaCy.Automation.Capture.GetDeviceCount(Nothing)
.Run()DeviceCount = .Output.ValueEnd With0
Answers
-
Addins should be able to call the same functions as macros. Just be sure that your addin has all necessary references (e.g. MediaCy.IQL.Capture.dll, MediaCy.Addins.Capture.dll).
Yuri0 -
Hi Yuri,
I include all of the capture's reference and test command.
But I can't find the suitable command.
Automation command in Project Workbench. I see the 'GetDeviceCount' and 'GetDeviceObject'.
In my Add-in project. The following are the capture item that I can use.
0 -
Please make sure MediaCy.Automation.dll is referenced in the project. It is located in a subfolder of the application folder called Automation (C:\Program Files\Media Cybernetics\Image-Pro 10\Automation). If you have a reference to MediaCy.Automation.Proxy.dll, it should be removed. This is not the reference to use.
Once the automation reference is available, you should see all of the capture commands as in project workbench.
Example:Dim DeviceCount As Integer = 0With MediaCy.Automation.Capture.GetDeviceCount(Nothing)DeviceCount = .Output.ValueEnd With
0 -
Hi Trey,
Thanks for your help!
I found out where is difference in automation.dll.
My reference path was old version of the dll.
0 -
Hi All,
I have another question.
I using QImaging Camrea. Then i tested command GetDeviceCount and got .Output.value =0.
It did not return the correct count.
Is there any other way to get device count or get device list ?
The following are my test results:
Sample Code:Dim captDeviceCount As Integer = 0 With mediacy.Automation.Capture.CaptureCommands.GetDeviceCount(NewMacro) captDeviceCount = .Output.Value End With MsgBox ("DeviceCount:" & captDeviceCount.ToString) MsgBox ("Application: " & ThisApplication.Capture.Devices.Count.tostring)
MsgBox ThisApplication.Capture.Devices.Item(0).DevName & vbNewLine & ThisApplication.Capture.Devices.item(1).DevName
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions