我正在使用 aForge,我正在尝试设置来自 USB 网络摄像头的视频源的分辨率,以便它正确地适合图片框。我的目标是 800x600 的分辨率,但我得到的默认分辨率约为 640x480。当我尝试设置分辨率时,我收到“无法修改只读字段的成员”的消息。有使用 aForge 经验的人有什么想法/解决方案吗?
问问题
19892 次
2 回答
19
确切地说:该desiredFrameSize
属性已过时。您必须使用该VideoResolution
物业;例如,使用分辨率编号 0:
yourvideoSource.VideoResolution = yourvideoSource.VideoCapabilities[0];
数组的编号代表不同的分辨率。
使用以下命令确定可用分辨率和尺寸的数量:
yourvideoSource.VideoCapabilities.Length;
for (int i = 0; i < yourvideoSource.VideoCapabilities.Length; i++ ){
string resolution= "Resolution Number "+Convert.Tostring(i);
string resolution_size = yourvideoSource.VideoCapabilities[i].FrameSize.ToString();
}
于 2014-01-05T03:10:53.990 回答
0
怎么设置
yourvideoSource.DesiredFrameSize = new Size(800, 600);
于 2013-10-17T18:00:33.300 回答