资源简介
用电脑摄像头扫描二维码 java做的一个小程序 很好用
代码片段和文件信息
package com.kc.fmj;
import javax.swing.Jframe;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.Hashtable;
import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.Player;
import javax.swing.JPanel;
import java.io.InputStream;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.DecodeHintType;
import com.google.zxing.LuminanceSource;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.Result;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.common.HybridBinarizer;
import net.sf.fmj.ui.application.CaptureDeviceBrowser;
import net.sf.fmj.ui.application.ContainerPlayer;
import net.sf.fmj.ui.application.PlayerPanelPrefs;
/**
*
* @author Lee
*
*/
public class Cameraframe extends Jframe{
/**
* @param args
* @throws
*/
public static void main(String[] args)throws Exception {
//InputStream is = new FileInputStream(“E:\\Epay_wordspace\\qrcode\\beep.mp3“);
//System.out.println(“InputStream:“+is);
Cameraframe camera = new Cameraframe();
camera.setVisible(true);
}
OpenUrl openUrl=new OpenUrl();
private static int num = 0;
public Cameraframe() throws Exception{
this.settitle(“摄像头读取二维码应用“);
this.setSize(480 500);
//this.setSize(250 280);
this.setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);
final JPanel cameraPanel = new JPanel();
this.getContentPane().setLayout(new BorderLayout());
this.getContentPane().add(cameraPanel BorderLayout.CENTER);
ContainerPlayer containerPlayer = new ContainerPlayer(cameraPanel);
MediaLocator locator = CaptureDeviceBrowser.run(null); //弹出摄像头设备选择
PlayerPanelPrefs prefs = new PlayerPanelPrefs();
containerPlayer.setMediaLocation(locator.toExternalForm() prefs.autoPlay);
new Thread() {
public void run() {
while (true) {
try {
Thread.sleep(1000);
Dimension imageSize = cameraPanel.getSize();
BufferedImage image = new BufferedImage(
imageSize.width imageSize.height
BufferedImage.TYPE_INT_ARGB);
Graphics2D g = image.createGraphics();
cameraPanel.paint(g);
g.dispose();
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
Hashtable hints = new Hashtable();
hints.put(DecodeHintType.CHAR
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-06-10 10:37 qrcodeReader\
文件 1035 2012-10-09 09:50 qrcodeReader\.classpath
文件 388 2012-10-09 09:49 qrcodeReader\.project
目录 0 2015-06-10 10:37 qrcodeReader\.settings\
文件 629 2012-10-09 09:49 qrcodeReader\.settings\org.eclipse.jdt.core.prefs
目录 0 2015-06-10 10:37 qrcodeReader\bin\
目录 0 2015-06-10 10:37 qrcodeReader\bin\com\
目录 0 2015-06-10 10:37 qrcodeReader\bin\com\kc\
目录 0 2015-06-10 10:37 qrcodeReader\bin\com\kc\fmj\
文件 2787 2015-06-10 10:37 qrcodeReader\bin\com\kc\fmj\Camerafr
文件 2073 2015-06-10 10:37 qrcodeReader\bin\com\kc\fmj\Camerafr
文件 2804 2015-06-09 10:12 qrcodeReader\bin\com\kc\fmj\Camerafr
文件 1974 2015-06-09 10:12 qrcodeReader\bin\com\kc\fmj\Camerafr
文件 2153 2015-06-10 10:36 qrcodeReader\bin\com\kc\fmj\OpenUrl.class
文件 159744 2007-09-28 09:39 qrcodeReader\civil.dll
文件 65536 2007-09-28 09:39 qrcodeReader\jdshow.dll
目录 0 2015-06-10 10:37 qrcodeReader\lib\
文件 64156 2012-06-06 00:00 qrcodeReader\lib\ffmpeg-java.jar
文件 937276 2012-06-06 00:25 qrcodeReader\lib\fmj-ap
文件 828244 2012-06-06 00:25 qrcodeReader\lib\fmj-nojmf.jar
文件 1007362 2012-06-06 00:03 qrcodeReader\lib\fmj.jar
文件 31946 2012-02-04 11:13 qrcodeReader\lib\javase.jar
文件 153253 2012-06-06 00:00 qrcodeReader\lib\jdom.jar
文件 105446 2012-06-06 00:00 qrcodeReader\lib\jl1.0.jar
文件 67867 2012-06-06 00:00 qrcodeReader\lib\lti-civil-no_s_w_t.jar
文件 24538 2012-06-06 00:00 qrcodeReader\lib\mp3spi1.9.4.jar
文件 1743059 2011-09-19 15:58 qrcodeReader\lib\substance.jar
文件 102723 2012-06-06 00:00 qrcodeReader\lib\tritonus_share.jar
文件 13776 2012-06-06 00:00 qrcodeReader\lib\vorbisspi1.0.2.jar
文件 373145 2012-09-26 17:45 qrcodeReader\lib\zxing-1.7.jar
目录 0 2015-06-10 10:37 qrcodeReader\src\
............此处省略8个文件信息
- 上一篇:运动会管理系统J2EE
- 下一篇:机房排课系统的设计与实现
相关资源
- Android之扫描二维码和根据输入信息生
- android手机扫描二维码开源代码
- Android webview调用摄像头扫描二维码
- Android高仿QQ扫描二维码功能实现
- Android 使用ZBar扫描二维码源码
- Xamarin.Android 扫描二维码并跳转网页
- Android使用Zbar实现二维码扫描功能
- 解决微信扫描二维码APK问题
- xamarin android使用zxing扫描二维码
- android zbar 扫描二维码(全新,秒扫,
- android前置摄像头扫描二维码
- java生成二维码、调用摄像头扫描二维
- java 扫描二维码登录 源码
- android Zxing扫描二维码条形码功能仿微
- 手机端网页调用摄像头 拍照识别二维
- Android 扫描二维码,类似微信的不断放
- 自定义的扫描二维码界面的cordova 扫码
- android 扫描二维码 并 生成二维码
- Android扫描二维码实现网页登录
- android 扫描二维码ZXing
- android 扫描二维码,条形码
- android扫描二维码,条形码整合
- android 扫描二维码(亲测通过,拿来即
- 条码扫描二维码
- android 仿QQ扫描二维码(竖屏)
- android 扫描二维码(带震动/有声音提
- android 扫描二维码
- 安卓扫描二维码以及解析
评论
共有 条评论