拼一把

 

《IT蓝豹》完整阅读软件客户端app

完整阅读软件客户端app,本项目里面还有扫描功能,搜索本地书籍,不过扫码功能通过c++层实现的。
本项目来自:https://github.com/JayFang1993/ScanBook
CaptureActivity主要是摄像头相关类,CaptureActivityHandler所有扫描消息都发到这个Handler类中
部分代码如下:
    private void initCamera(SurfaceHolder surfaceHolder) {
        try {
            CameraManager.get().openDriver(surfaceHolder);
        } catch (IOException ioe) {
            return;
        } catch (RuntimeException e) {
            return;
        }
        if (handler == null) {
            handler = new CaptureActivityHandler(this, decodeFormats,characterSet);
        }
    }

    public void surfaceChanged(SurfaceHolder holder, int format, int width,
            int height) {

    }

    public void surfaceCreated(SurfaceHolder holder) {
        if (!hasSurface) {
            hasSurface = true;
            initCamera(holder);
        }

    }

    public void surfaceDestroyed(SurfaceHolder holder) {
        hasSurface = false;

    }

运行效果:

 

源码地址:http://www.itlanbao.com/code/20151103/10000/100609.html

posted on 2015-11-10 14:24  拼一把  阅读(185)  评论(0编辑  收藏  举报

导航