如题,我已经安装了一个摄像头,但不知道怎样捕获图像。
我只是知道用 用VFW api 的类实现。但不知在Delphi下怎样处理,请各位帮帮手。谢谢了

解决方案 »

  1.   

    用VFW,VCHelp上有一个例子,是VC的http://www.vchelp.net/vchelp/view_article.asp?ft=2&article_id=943
      

  2.   

    VFW这么古老的东西谁还在用?说出去很让人笑话啦,用DS吧。
    procedure TVideoForm.OnSelectDevice(sender: TObject);
    begin
      FilterGraph.ClearGraph;
      FilterGraph.Active := false;
      Filter.BaseFilter.Moniker := SysDev.GetMoniker(TMenuItem(Sender).tag);
      FilterGraph.Active := true;
      with FilterGraph as ICaptureGraphBuilder2 do
      begin
        CheckDSError(RenderStream(@PIN_CATEGORY_CAPTURE , nil, Filter as IBaseFilter, nil, ASFWriter as IbaseFilter));
        CheckDSError(RenderStream(@PIN_CATEGORY_PREVIEW , nil, Filter as IBaseFilter, nil, VideoWindow as IbaseFilter));
      end;
      FilterGraph.Play;
    end;//前提,你得装DSPACK。