如何将网络摄像机的大小从VFrames中的默认值(640x360)更改为新的默认值(160x120)。

我正在使用this component上的this page

最佳答案

VFrame中有一个预定义的方法

var
  cam:TVideoImage;
  camlist:TStringList;
  reslist:TStringList;
  vp:TVideoProperty;
begin

   camlist := TStringList.Create ;
   reslist :=TStringList.Create;

   cam := TVideoImage.Create;
   cam.GetListOfDevices(camlist);

   cam.SetDisplayCanvas(PaintBox1.Canvas);

   cam.VideoStart(camlist.Strings[0])    ;

   // important

   cam.GetListOfSupportedVideoSizes(reslist);
   ListBox1.Items := reslist;
   cam.SetResolutionByIndex(0);

   //specify your resolution by index using listbox index
   //this will not only lists resolutions but also other features available , so be careful when selecting the index
end;


确保在视频开始播放后执行GetListOfSupportedVideoSizesSetResolutionByIndex

10-08 14:01