【问题标题】:store custom size of image immediately taken by camera存储相机立即拍摄的图像的自定义大小
【发布时间】:2014-08-01 11:29:18
【问题描述】:

我正在使用MediaStore.ACTION_IMAGE_CAPTURE 从相机拍照并使用光标将BLOB 存储为数据库。稍后我将通过网络上传它。

onActivityResult 上,我正在使用getParcelable 获取字节数组,如下所示

 Bitmap bitmap = extras.getParcelable("data");
 ByteArrayOutputStream stream = new ByteArrayOutputStream();
 bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
 byte imageInByte[] = stream.toByteArray();
 // dumping imageInByte in db , later on i am accessing the same byte array and sending 
 // over network

但问题是,图像大小是144 X 192,它非常小,所以有一个 存储自定义尺寸图像的方式,例如300 X 300

【问题讨论】:

    标签: android android-camera-intent android-bitmap


    【解决方案1】:

    尝试This 将帮助您拍摄自定义尺寸的相机照片。这个例子有小尺寸和大尺寸的图片捕捉例子

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-19
      • 2017-09-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多