当前位置: 首页>>代码示例>>Java>>正文


Java ShutterCallback类代码示例

本文整理汇总了Java中android.hardware.Camera.ShutterCallback的典型用法代码示例。如果您正苦于以下问题:Java ShutterCallback类的具体用法?Java ShutterCallback怎么用?Java ShutterCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ShutterCallback类属于android.hardware.Camera包,在下文中一共展示了ShutterCallback类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: requestTakePicture

import android.hardware.Camera.ShutterCallback; //导入依赖的package包/类
public void requestTakePicture(
        final ShutterCallback shutter,
        final PictureCallback raw,
        final PictureCallback postView,
        final PictureCallback jpeg) {
    post(new Runnable() {
        @Override
        public void run() {
            try {
                mCamera.takePicture(shutter, raw, postView, jpeg);
            } catch (RuntimeException e) {
                // TODO: output camera state and focus state for debugging.
                Log.e(TAG, "take picture failed.");
                throw e;
            }
        }
    });
}
 
开发者ID:asm-products,项目名称:nexus-camera,代码行数:19,代码来源:AndroidCameraManagerImpl.java

示例2: AutoFocusManager

import android.hardware.Camera.ShutterCallback; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public AutoFocusManager(final Context context, Camera camera,
                        final boolean canDisableSystemShutterSound) {
    this.camera = camera;
    this.executor = Executors.newSingleThreadScheduledExecutor();

    this.focusAccelerationEventListener = new FocusAccelerationEventListener(
            context, SensorManager.SENSOR_DELAY_GAME);
    this.focusAmbientLightEventListener = new FocusAmbientLightEventListener(
            context, SensorManager.SENSOR_DELAY_GAME);

    String focusMode = this.camera.getParameters().getFocusMode();
    this.must_call_auto_focus = Camera.Parameters.FOCUS_MODE_AUTO
            .equals(focusMode)
            || Camera.Parameters.FOCUS_MODE_MACRO.equals(focusMode);

    int[] soundRes = new int[0];
    if (this.must_call_auto_focus) {
        soundRes = Arrays.copyOf(soundRes, soundRes.length + 1);
        soundRes[soundRes.length - 1] = R.raw.beep;
    }
    if (canDisableSystemShutterSound) {
        soundRes = Arrays.copyOf(soundRes, soundRes.length + 1);
        soundRes[soundRes.length - 1] = R.raw.shutter;
    }

    this.soundManager = new SoundManager(context, soundRes);

    if (canDisableSystemShutterSound) {
        this.shutterCallback = new ShutterCallback() {
            @Override
            public void onShutter() {
                AutoFocusManager.this.soundManager.play(R.raw.shutter);
            }
        };
    }

}
 
开发者ID:hschott,项目名称:Camdroid,代码行数:39,代码来源:AutoFocusManager.java

示例3: onCreate

import android.hardware.Camera.ShutterCallback; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	int type = getArguments().getInt(CameraActivity.ARGS_TYPE);
	String creatureName = getArguments().getString(CameraActivity.ARGS_NAME, null);
	final String filePath;

	MyCameraHost host;
	switch(type){
	case 1:
		host = new CreatureCameraHost(getActivity(), creatureName);
		filePath = CreatureCameraHost.getFilePath(creatureName).getPath();
		break;
	default:
		throw new IllegalArgumentException("No camera host type declared. Use CameraActivity.ARGS_TYPE_... as argument");
	}

	ShutterCallback callback = new ShutterCallback() {

		@Override
		public void onShutter() {
			Intent i = new Intent();
			i.putExtra(CameraActivity.DATA_PATH, filePath);
			mActivity.setResult(Activity.RESULT_OK, i);
			mActivity.finish();
		}
	};
	
	host.setShutterCallback(callback);

	setHost(host);
	setHasOptionsMenu(true);
}
 
开发者ID:WindcatcherMedia,项目名称:dmhelper,代码行数:35,代码来源:MyCameraFragment.java

示例4: onTakePicture

import android.hardware.Camera.ShutterCallback; //导入依赖的package包/类
public void onTakePicture(File file, onPictureSaveListener listener,ShutterCallback shutterCallback){
	CameraEngine.setRotation(90);
	mSaveTask = new SaveTask(mContext, file, listener);
	CameraEngine.takePicture(shutterCallback, null, mPictureCallback);
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:6,代码来源:MagicCameraDisplay.java

示例5: getShutterCallback

import android.hardware.Camera.ShutterCallback; //导入依赖的package包/类
@Override
public ShutterCallback getShutterCallback() {
	return null;
}
 
开发者ID:WindcatcherMedia,项目名称:dmhelper,代码行数:5,代码来源:MyCameraHost.java

示例6: setShutterCallback

import android.hardware.Camera.ShutterCallback; //导入依赖的package包/类
public void setShutterCallback(ShutterCallback callback){
	mCallback = callback;
}
 
开发者ID:WindcatcherMedia,项目名称:dmhelper,代码行数:4,代码来源:MyCameraHost.java


注:本文中的android.hardware.Camera.ShutterCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。