网上代码我也看了,没弄出来,大家有没有弄过的,告诉我一下怎么弄?

解决方案 »

  1.   

    Flex..或者java调用摄像头驱动...没弄过,大概是这个思路吧.
      

  2.   

    正好我最近在弄JAVA摄像头东西JAVA加载摄像头需要用JMF框架,这个LZ可以去SUN的主页下到,具体的配置搜下就有了
    我这个是在用JFrame的
    加载的代码是这样的:public JPanel contentPane = new JPanel();
    public void getvideo(){
    CaptureDeviceInfo di = null;
            MediaLocator ml = null;
            Player player = null;
    Vector deviceList = CaptureDeviceManager.getDeviceList(null);
    if(deviceList!=null)
    {
    for(int i=0;i<deviceList.size();i++)
    {
    di=(CaptureDeviceInfo)deviceList.elementAt(i);
    if(di.getName().startsWith("vfw:")){
    ml=di.getLocator();
    }
    }
    }
    else{
    System.err.print("No Capture Device");
    System.exit(-1);
    }

    try {
    player = Manager.createRealizedPlayer(ml);
    player.start();
    Component comp;
    if((comp = player.getVisualComponent())!=null)
    { comp.setBounds(new Rectangle(0, 40,320, 240));
    contentPane.add(comp,BorderLayout.NORTH);
    }
    } catch (NoPlayerException e) {

    e.printStackTrace();
    } catch (CannotRealizeException e) {

    e.printStackTrace();
    } catch (IOException e) {

    e.printStackTrace();
    }

    }再把contentPane添加到JFrame里面,这个就可以在一个JFrame的框架用摄像头了还有,要注意个事,就是第一次使用摄像头的话,要用JMF带的程序JMF Registry选到capture Devices中注册下,不然是找不到驱动的
      

  3.   

    JMF呀。这个框架好像听说过,好像又没有
      

  4.   

    JMF的方案需要客户端安装jre,这个是不现实的,可以看看ImageCapOnWeb控件,这里有示例代码:
    http://peihexian.iteye.com/blog/676246