webcamapplet.java

来自「一个基于linux下的摄像头应用程序」· Java 代码 · 共 46 行

JAVA
46
字号
/* * WebCamApplet.java * * Created on February 25, 2002, 8:47 AM */import java.io.*;import java.awt.*;import java.applet.*;import java.net.URL;import java.net.MalformedURLException;/** * * @author  mike morrison */public class WebCamApplet extends Applet {    private ImageDownloader downloader;    private ImageCanvas ic;    /** Creates a new instance of WebCamApplet */    public WebCamApplet() {            }    public void init () {        try{                        int width = Integer.parseInt(this.getParameter("width"));            int height = Integer.parseInt(this.getParameter("height"));	    int defFPS = Integer.parseInt(this.getParameter("FPS"));            URL hostURL = new URL(getParameter("URL"));            setLayout(new GridLayout());            ic = new ImageCanvas(this,hostURL.getHost(),hostURL.getPort(),defFPS,width,height);            add(ic);        }catch(NumberFormatException e){            e.printStackTrace();        }catch(MalformedURLException e){            e.printStackTrace();        }    }    public void stop(){        ic.disconnect();        ic = null;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?