问题描述
我与aForge工作,我试图设置从USB摄像头视频馈送分辨率,因此在PictureBox恰当地。我的目标800x600的分辨率,但是默认分辨率我得到的是640×480左右。当我尝试将分辨率设置,我得到的信息是只读域的成员不能被修改。有谁与aForge经验,有任何想法/解决方案?
I'm working with aForge and I'm attempting to set the resolution for a video feed from an USB webcam so it fits properly in a pictureBox. I'm aiming for a resolution of 800x600, but the default resolution I get is about 640x480. When I try to set the resolution, I get the message that "members of readonly field cannot be modified". Does anyone with experience with aForge have any ideas/a solution?
推荐答案
正是desiredFrameSize属性是过时的。
必须使用使用属性VideoResolution,例如分辨率数0:
exactly the desiredFrameSize property is obsolete.You must use the property VideoResolution, for example using resolution number 0:
yourvideoSource.VideoResolution = yourvideoSource.VideoCapabilities[0];
阵列的数目,代表不同的分辨率。
the number of the array, represents a different resolution.
使用以下命令来确定可用的分辨率和尺寸的量:
Use the following command to determine the amount of available resolutions and dimensions:
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();
}
这篇关于如何设置视频分辨率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!