ShotCutThread.java
资源名称:J2ME.rar [点击查看]
上传用户:sygbg6
上传日期:2020-12-29
资源大小:4884k
文件大小:1k
源码类别:
游戏
开发平台:
Java
- package cn.com.imageanalyze;
- import javax.microedition.media.MediaException;
- import javax.microedition.media.control.VideoControl;
- /**
- * 一秒钟间隔 拍照线程
- *
- * @author Administrator
- *
- */
- public class ShotCutThread extends Thread {
- private VideoControl vc = null;
- private MainForm form = null;
- public ShotCutThread(MainForm form,VideoControl vc){
- this.form = form;
- this.vc = vc;
- }
- public void run() {
- byte[] buff = null;
- try {
- buff = vc.getSnapshot("encoding=jpeg&width=320&height=240");
- } catch (MediaException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- // try {
- // buff = vc.getSnapshot("encoding=jpeg");
- // } catch (MediaException ee) {
- // // TODO Auto-generated catch block
- // ee.printStackTrace();
- // }
- }
- form.finish(buff);
- }
- }