【发布时间】:2015-09-07 12:50:16
【问题描述】:
我正在使用 AForge.net version 2.25 显示来自 USB 数码显微镜 Celestron 44302-B 的视频馈送。使用显微镜软件,视频在 Windows 7 x64 工作站上正确显示。
代码基于 Aforge 的示例应用程序。结果如下所示,其中 AForge.Controls.videoSourcePlayer 中的视频源是颠倒的。
我可以轻松翻转单个位图(从视频流中截取的快照),但我希望允许用户在连接并运行视频源时定位和聚焦显微镜。
using AForge.Controls
using AForge.Video;
using AForge.Video.DirectShow;
void connectButton_Click(object sender, EventArgs e)
{
VideoCaptureDevice _videoDevice = new VideoCaptureDevice(_videoDevices[devicesCombo.SelectedIndex].MonikerString);
if (_videoDevice != null)
{
if ((_videoCapabilities != null) && (_videoCapabilities.Length != 0))
{
_videoDevice.VideoResolution = _videoCapabilities[videoResolutionsCombo.SelectedIndex];
}
if ((_snapshotCapabilities != null) && (_snapshotCapabilities.Length != 0))
{
_videoDevice.ProvideSnapshots = true;
_videoDevice.SnapshotResolution = _snapshotCapabilities[snapshotResolutionsCombo.SelectedIndex];
_videoDevice.SnapshotFrame += videoDevice_SnapshotFrame;
}
EnableConnectionControls(false);
videoSourcePlayer.VideoSource = _videoDevice;
videoSourcePlayer.Start();
}
}
【问题讨论】:
-
你确定显微镜不是背对前的吗?
-
我不这么认为,因为我最初使用的是 DirectShowLib-2005 并且视频方向是正确的。但是,DirectShowLib 有点问题,有时视频源会锁定,需要重新启动我的应用程序。
标签: c# windows-7-x64 aforge