AForge.net摄像头预览分辨率的问题

.Net技术 码拜 9年前 (2015-05-10) 4820次浏览 0个评论

AForge.net老版本在预览摄像头时可通过设置DesiredFrameSize 属性,设置摄像头支持的分辨率;
而新版本的AForge.net(版本2.2.5.0)的该属性提示已过时,所以设置分辨率也无效。
我的摄像头是130w的,可支持1280*1024和640*480分辨率。
老版本的可通过设置DesiredFrameSize值,实行两种分辨率的预览;而新的版本即便设置了也仅默认为640*480。

贴部分代码
videoSource = new VideoCaptureDevice(videoDevices[ScanID].MonikerString);
                    videoSource.DesiredFrameSize = new Size(1280, 1024);//新版本提示已过时
                    videoSource.DesiredFrameRate = 1;
                    videoSourcePlayer1.VideoSource = videoSource;
                    videoSourcePlayer1.Start();

系统win7 ,工具VS2010

问下各位大侠,新版本的AForge怎么设置摄像头预览的分辨率呢?或者说微软为什么会让此属性过时呢?

自己顶一下@@@
再顶  找大侠哦
100分
微软是不会让这个属性过时的。
1,你找找aforge里有没有其他属性或者方法是设置这个参数的。
2,使用windowsAPI给摄像头发消息。
已解决。结贴
楼主,怎么个情况?我这最大也只能选择640*480,还有别的,分辨率可选么?谢谢
怎么解决的,能说下吗?
引用 6 楼 wangping1125 的回复:

怎么解决的,能说下吗?

换用VideoResolution属性
videoSource.VideoResolution = videoSource.VideoCapabilities[i];

引用 7 楼 u012436908 的回复:
Quote: 引用 6 楼 wangping1125 的回复:

怎么解决的,能说下吗?

换用VideoResolution属性
videoSource.VideoResolution = videoSource.VideoCapabilities[i];

AForge.Video.dll中没有说到的那个属性,请问能告诉我在哪里?

VideoResolution是videoSource对象的属性,而videoSource 是VideoCaptureDevice 对象,这个对象在AForge.Video.DirectShow命名空间下,你还要引入 AForge.Video.DirectShow.dll,而不光是AForge.Video.dll
忘了引用了

引用 8 楼 yaj52125 的回复:
Quote: 引用 7 楼 u012436908 的回复:
Quote: 引用 6 楼 wangping1125 的回复:

怎么解决的,能说下吗?

换用VideoResolution属性
videoSource.VideoResolution = videoSource.VideoCapabilities[i];

AForge.Video.dll中没有说到的那个属性,请问能告诉我在哪里?


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明AForge.net摄像头预览分辨率的问题
喜欢 (1)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!