EasyCamera, android摄像机类周围的包装,简化了它的使用

分享于 

2分钟阅读

GitHub

  繁體 雙語
Wrapper around the android Camera class that simplifies its usage
  • 源代码名称:EasyCamera
  • 源代码网址:http://www.github.com/Glamdring/EasyCamera
  • EasyCamera源代码文档
  • EasyCamera源代码下载
  • Git URL:
    git://www.github.com/Glamdring/EasyCamera.git
    Git Clone代码到本地:
    git clone http://www.github.com/Glamdring/EasyCamera
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/Glamdring/EasyCamera
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
    EasyCamera

    围绕android摄像机类的包装器简化它的使用( 阅读更多关于该进程的信息)

    使用方法:

    // the surface where the preview will be displayedSurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView);EasyCamera camera =DefaultEasyCamera.open();CameraActions actions = camera.startPreview(surfaceView.getHolder());PictureCallback callback =newPictureCallback() {
     publicvoidonPictureTaken(byte[] data, CameraActionsactions) {
     // store picture }
    };
    actions.takePicture(Callbacks.create().withJpegCallback(callback));

    默认情况下,当拍摄图片时预览停止。 如果要重新启动预览,请指定 .withRestartPreviewAfterCallbacks(true)Callbacks 对象上

    如果你需要 android.hardware.Camera 对象,通过 camera.getRawCamera() 获取它

    如何在 Maven 中导入:

     <dependency>
     <groupId>net.bozho.easycamera</groupId>
     <artifactId>easycamera</artifactId>
     <version>0.0.1</version>
     <type>aar</type>
     </dependency>

    如何在gradle中导入:

     compile 'net.bozho.easycamera:easycamera:0.0.1:aar@aar'

    相关文章