基本信息
源码名称:android camera 摄像头拍照例子源码
源码大小:0.57M
文件格式:.zip
开发语言:Java
更新时间:2014-11-10
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 3 元 
   源码介绍



package de.ecotastic.android.camerautil.example;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import de.ecotastic.android.camerautil.R;
import de.ecotastic.android.camerautil.lib.CameraIntentHelperActivity;
import de.ecotastic.android.camerautil.util.BitmapHelper;

/**
 * Example Activity of how to use the CameraIntentHelperActivity
 * 
 * @author Ralf Gehrer <ralf@ecotastic.de>
 */
public class TakePhotoActivity extends CameraIntentHelperActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_take_photo);
	}
	
	public void onStartCamera(View view) {
		startCameraIntent();
	}
	
	@Override
	protected void onPhotoUriFound() {
		TextView uirView = (TextView) findViewById(R.id.activity_take_photo_image_uri);
		uirView.setText("photo uri: "   photoUri.toString());
		
		Bitmap photo = BitmapHelper.readBitmap(this, photoUri);
        if (photo != null) {
            photo = BitmapHelper.shrinkBitmap(photo, 300, rotateXDegrees);
            ImageView imageView = (ImageView) findViewById(R.id.activity_take_photo_image_view);
 			imageView.setImageBitmap(photo); 
        }
		
        //Delete photo in second location (if applicable)
        if (preDefinedCameraUri != null && !preDefinedCameraUri.equals(photoUri)) {
        	BitmapHelper.deleteImageWithUriIfExists(preDefinedCameraUri, this);
        }
        //Delete photo in third location (if applicable)
        if (photoUriIn3rdLocation != null) {
        	BitmapHelper.deleteImageWithUriIfExists(photoUriIn3rdLocation, this);
        }
	}
	
	@Override
	protected void onPhotoUriNotFound() {
		super.onPhotoUriNotFound();
		TextView uirView = (TextView) findViewById(R.id.activity_take_photo_image_uri);
		uirView.setText("photo uri: not found");
	}
}