| 订阅 | 在线投稿
分享
 
 
 

JMF驱动问题

2006-04-19 14:25:04  编辑来源:互联网  宽屏版  评论

本文为【JMF驱动问题】的汉字拼音对照版显示拼音

xiamianshiyiduanbuhuoniexiangtoushujudechengxuyunxingchenggongwoxiangbuhuoxianshiqideshujuyinggaizenmebanstr2shiniexiangtouqudongdemingzinaxianshiqiqudongdemingzishishenme

geweidaxiaqingzhijiaoxiaodixianxiexiele

import javax.media.*;

import java.awt.event.*;

import java.awt.*;

public class SpJieKou {

public static Player player;

private CaptureDeviceInfo di;

private MediaLocator ml;

String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";

public SpJieKou(){

try{

di = CaptureDeviceManager.getDevice(str2);

ml = di.getLocator();

player = Manager.createRealizedPlayer(ml);

player.start();

}catch(Exception e){

e.printStackTrace();

}

}//end

void go(){

HqFrame fr = new HqFrame();

Component comp;

if ((comp = player.getVisualComponent()) != null)

{

fr.add(comp, BorderLayout.CENTER);

fr.setVisible(true);

}

}//end

public static void main(String[] args) {

SpJieKou sss = new SpJieKou();

sss.go();

}//end

}

//YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

class HqFrame extends Frame {

public HqFrame() {

MenuBar menuBar = new MenuBar();

Menu menuFile = new Menu();

MenuItem menuFileExit = new MenuItem();

menuFile.setLabel("File");

menuFileExit.setLabel("Exit");

menuFileExit.addActionListener

(

new ActionListener() {

public void actionPerformed(ActionEvent e) {

HqFrame.this.windowClosed();

}

}

);

menuFile.add(menuFileExit);

menuBar.add(menuFile);

setTitle("Hq");

setMenuBar(menuBar);

setSize(new Dimension(450, 400));

this.addWindowListener

(

new WindowAdapter() {

public void windowClosing(WindowEvent e) {

HqFrame.this.windowClosed();

}

}

);

}

protected void windowClosed() {

System.exit(0);

}

}

原文
下面是一段捕获摄像头数据的程序(运行成功),我想捕获显示器的数据应该怎么办,str2是摄像头驱动的名字,那显示器驱动的名字是什么? 各位大侠请指教,小弟先谢谢了 import javax.media.*; import java.awt.event.*; import java.awt.*; public class SpJieKou { public static Player player; private CaptureDeviceInfo di; private MediaLocator ml; String str2 = "vfw:Microsoft WDM Image Capture (Win32):0"; public SpJieKou(){ try{ di = CaptureDeviceManager.getDevice(str2); ml = di.getLocator(); player = Manager.createRealizedPlayer(ml); player.start(); }catch(Exception e){ e.printStackTrace(); } }//end void go(){ HqFrame fr = new HqFrame(); Component comp; if ((comp = player.getVisualComponent()) != null) { fr.add(comp, BorderLayout.CENTER); fr.setVisible(true); } }//end public static void main(String[] args) { SpJieKou sss = new SpJieKou(); sss.go(); }//end } //YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY class HqFrame extends Frame { public HqFrame() { MenuBar menuBar = new MenuBar(); Menu menuFile = new Menu(); MenuItem menuFileExit = new MenuItem(); menuFile.setLabel("File"); menuFileExit.setLabel("Exit"); menuFileExit.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { HqFrame.this.windowClosed(); } } ); menuFile.add(menuFileExit); menuBar.add(menuFile); setTitle("Hq"); setMenuBar(menuBar); setSize(new Dimension(450, 400)); this.addWindowListener ( new WindowAdapter() { public void windowClosing(WindowEvent e) { HqFrame.this.windowClosed(); } } ); } protected void windowClosed() { System.exit(0); } }
󰈣󰈤
 
 
 
>>返回首页<<
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
王朝网络微信公众号
微信扫码关注本站公众号wangchaonetcn
 
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
©2005- 王朝网络 版权所有