java如何调用摄像头呀? 网上代码我也看了,没弄出来,大家有没有弄过的,告诉我一下怎么弄? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Flex..或者java调用摄像头驱动...没弄过,大概是这个思路吧. 正好我最近在弄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中注册下,不然是找不到驱动的 JMF呀。这个框架好像听说过,好像又没有 JMF的方案需要客户端安装jre,这个是不现实的,可以看看ImageCapOnWeb控件,这里有示例代码:http://peihexian.iteye.com/blog/676246 java 拼写sql的问题 关于Java自动从某网站周期性下载一资源的问题??? 有点短路了.... 求一条正则表达式 用java进行base64编码的时候,效率很低,如何解决 eclipse 打包问题! 想要一个画饼分图的程序,有谁能帮我吗?急用 关于多线程的小问题(求解) JAVA J2EE EJB JAVABEAN 究竟有什么关系 用java如何合成多幅图片 java画图如何避免闪烁 帮助~~~
我这个是在用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中注册下,不然是找不到驱动的
http://peihexian.iteye.com/blog/676246