读书人

delphi7中怎么枚举摄像头支持的分辨率

发布时间: 2013-07-08 14:13:00 作者: rapoo

delphi7中如何枚举摄像头支持的分辨率
delphi7中怎么枚举摄像头支持的分辨率delphi7中怎么枚举摄像头支持的分辨率求大神 搭救 Delphi 摄像头
[解决办法]
用DSPack的话:
procedure TCaptureWindow.GetMediaTypeListByType(const AType: TGuid;
const AList: TStrings);
var
i: Integer;
c: Integer;
size : Integer;
cgb: ICaptureGraphBuilder2;
cfg: IAMStreamConfig;
pmt: PAMMediaType;
scc: TVideoStreamConfigCaps;
ibf : IBaseFilter;
begin
try
cgb := FFilterGraph as ICaptureGraphBuilder2; //

if Failed(FFilter.QueryInterface(IID_IBaseFilter, ibf)) then Exit;
if Failed(cgb.FindInterface(@AType, @MEDIATYPE_Video, ibf, IID_IAMStreamConfig, cfg)) then Exit;
if Failed(cfg.GetNumberOfCapabilities(c, Size)) then Exit;
AList.Clear;
for i := 0 to c - 1 do
begin
if Failed(cfg.GetStreamCaps(i, pmt, scc)) then Break;
AList.Add(GetMediaTypeDescription(pmt));
DeleteMediaType(pmt);
end;
finally
cgb := nil;
cfg := nil;
end;
end;

调用:
GetMediaTypeListByType(PIN_CATEGORY_CAPTURE, FMediaTypeList); //录像
GetMediaTypeListByType(PIN_CATEGORY_STILL, FMediaTypeList); //拍照

读书人网 >.NET

热点推荐