當前位置: 首頁>>代碼示例>>Java>>正文


Java Camera.ShutterCallback方法代碼示例

本文整理匯總了Java中android.hardware.Camera.ShutterCallback方法的典型用法代碼示例。如果您正苦於以下問題:Java Camera.ShutterCallback方法的具體用法?Java Camera.ShutterCallback怎麽用?Java Camera.ShutterCallback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.hardware.Camera的用法示例。


在下文中一共展示了Camera.ShutterCallback方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: takePhoto

import android.hardware.Camera; //導入方法依賴的package包/類
public void takePhoto(){
    Camera.ShutterCallback shutterCallback = new Camera.ShutterCallback() {
        public void onShutter() {
            Log.d(TAG, "onShutter: ");
        }
    };

    Camera.PictureCallback jpegCallback = new Camera.PictureCallback() {
        public void onPictureTaken(final byte[] data, final Camera camera) {
            camera.startPreview();
            Log.d(TAG, "onPictureTaken: ");
            pictureTakenCallBack.saveAsBitmap(data);
        }
    };

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        camera.enableShutterSound(false);
    }

    camera.takePicture(shutterCallback, null, jpegCallback);
}
 
開發者ID:zhangyaqiang,項目名稱:Fatigue-Detection,代碼行數:22,代碼來源:CameraEngine.java

示例2: rawCallbackOrNull

import android.hardware.Camera; //導入方法依賴的package包/類
private Camera.ShutterCallback rawCallbackOrNull(final EasyCamera.ShutterCallback callback) {
    if (callback != null) {
        return new Camera.ShutterCallback() {
            @Override
            public void onShutter() {
                callback.onShutter();
            }
        };
    }
    return null;
}
 
開發者ID:PacktPublishing,項目名稱:Expert-Android-Programming,代碼行數:12,代碼來源:DefaultCameraActions.java

示例3: takePicture

import android.hardware.Camera; //導入方法依賴的package包/類
public static void takePicture(Camera.ShutterCallback shutterCallback, Camera.PictureCallback rawCallback, 
		Camera.PictureCallback jpegCallback){
	mCamera.takePicture(shutterCallback, rawCallback, jpegCallback);
}
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:5,代碼來源:CameraEngine.java

示例4: takePicture

import android.hardware.Camera; //導入方法依賴的package包/類
public void takePicture(Camera.ShutterCallback shutter, Camera.PictureCallback raw,
        Camera.PictureCallback jpeg) {
    if (mCamera != null) {
        mCamera.takePicture(shutter, raw, jpeg);
    }
}
 
開發者ID:hoanganhtuan95ptit,項目名稱:EditPhoto,代碼行數:7,代碼來源:CameraController.java

示例5: takeShot

import android.hardware.Camera; //導入方法依賴的package包/類
public void takeShot(Camera.ShutterCallback shutterCallback,
                     Camera.PictureCallback rawPictureCallback,
                     Camera.PictureCallback jpegPictureCallback ){

    mCamera.takePicture(shutterCallback, rawPictureCallback, jpegPictureCallback);
}
 
開發者ID:simplezhli,項目名稱:Tesseract-OCR-Scanner,代碼行數:7,代碼來源:CameraManager.java


注:本文中的android.hardware.Camera.ShutterCallback方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。