本文整理匯總了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);
}
示例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;
}
示例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);
}
示例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);
}
}
示例5: takeShot
import android.hardware.Camera; //導入方法依賴的package包/類
public void takeShot(Camera.ShutterCallback shutterCallback,
Camera.PictureCallback rawPictureCallback,
Camera.PictureCallback jpegPictureCallback ){
mCamera.takePicture(shutterCallback, rawPictureCallback, jpegPictureCallback);
}