• 拍照返回的bitmap太小


    private void doPhoto(int requestCode)
    	{
    		if(!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
    			showToast(this, "请插入SD存储卡");
    			return;
    		}
    		Intent i = new Intent("android.media.action.IMAGE_CAPTURE");
    		picPath = Environment.getExternalStorageDirectory() + "/" + System.currentTimeMillis() + ".png";
    		File file = new File(picPath);
    		Uri imageUri = Uri.fromFile(file);
    		i.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
    		
    		
    		startActivityForResult(i, requestCode);
    	}
    
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    
    		this.data = data;
    
    		switch (requestCode) {
    		
    		
    		case RequestCode_Camera_Self:// 自拍照
    			if (resultCode == Activity.RESULT_OK)
    			{
    				File file = new File(picPath);
    				
    				Bitmap bmp = createImageThumbnail(picPath,400);
    				byte[] datas = bitmap2Bytes(bmp,
    						CompressFormat.JPEG);
    				tfPhoto.setProperty("text", datas);
    				tfPhoto.setImageBitmap(bmp); // 设置照片现实在界面上
    				file.delete();
    			}
    			return;
    
  • 相关阅读:
    【转载】Linux 内核启动时间分析
    hackbench
    c用户组函数
    c环境变量操作函数
    c网络接口套接字函数
    c信号处理函数
    c进程操作函数
    c文件内容操作函数
    c文件操作
    c数据结构和算法
  • 原文地址:https://www.cnblogs.com/jiayonghua/p/3272794.html
Copyright © 2020-2023  润新知