There are a quite a few of sources to get a video stream from webcam into a picturebox embedded in a userform.
有很多资源可以将来自网络摄像头的视频流导入嵌入用户窗体的图片框中。
- Preview a camera in DirectShow and capture a still image - in VB.net
- 在DirectShow中预览相机并捕获静态图像 - 在VB.net中
- How do i use attached webcams to take still image in my application
- 如何使用附加的网络摄像头在我的应用程序中拍摄静止图像
However, I am trying to do something a little neater, basically have a the preview of the video stream from webcam in a control that is embedded directly into the sheet rather than on a floating userform. I am not sure if this possible. I would very much appreciate any pointers.
但是,我正在尝试做一些更整洁的事情,基本上可以直接嵌入到工作表而不是浮动用户窗体的控件中预览来自网络摄像头的视频流。我不确定这是否可能。我非常感谢任何指针。
1 个解决方案
#1
0
(Answer from TnTinMn's comment - Posting as an answer to remove from 'Unanswered' queue)
(来自TnTinMn评论的答案 - 发布作为从“未答复”队列中删除的答案)
If you can write a .Net WinForm UserControl to view your video stream, then you should be able to produce a ActiveX UserControl that you can utilize in Excel.
如果您可以编写.Net WinForm UserControl来查看视频流,那么您应该能够生成可以在Excel中使用的ActiveX UserControl。
Get the Microsoft InteropForms Toolkit 2.1 .
获取Microsoft InteropForms Toolkit 2.1。
Even though it was originally intended to allow .Net UC usage in VB6, it works fine to write UCs for use in Excel.
即使它原本打算允许在VB6中使用.Net UC,但它可以很好地编写用于Excel的UC。
As a test, I just wrote one that used the Windows Media Player and it played the video fine as a UserControl on the worksheet.
作为测试,我刚刚写了一个使用Windows Media Player的视频,它在工作表上作为UserControl播放视频。
Start VS as an Admin as it needs to be able to register the control.
以管理员身份启动VS,因为它需要能够注册控件。
#1
0
(Answer from TnTinMn's comment - Posting as an answer to remove from 'Unanswered' queue)
(来自TnTinMn评论的答案 - 发布作为从“未答复”队列中删除的答案)
If you can write a .Net WinForm UserControl to view your video stream, then you should be able to produce a ActiveX UserControl that you can utilize in Excel.
如果您可以编写.Net WinForm UserControl来查看视频流,那么您应该能够生成可以在Excel中使用的ActiveX UserControl。
Get the Microsoft InteropForms Toolkit 2.1 .
获取Microsoft InteropForms Toolkit 2.1。
Even though it was originally intended to allow .Net UC usage in VB6, it works fine to write UCs for use in Excel.
即使它原本打算允许在VB6中使用.Net UC,但它可以很好地编写用于Excel的UC。
As a test, I just wrote one that used the Windows Media Player and it played the video fine as a UserControl on the worksheet.
作为测试,我刚刚写了一个使用Windows Media Player的视频,它在工作表上作为UserControl播放视频。
Start VS as an Admin as it needs to be able to register the control.
以管理员身份启动VS,因为它需要能够注册控件。