裁剪所选图片并发送到android中上传

问题描述

我得到了图像:

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent,REQUEST_galLERY_CODE);

onActivityResult:

case REQUEST_galLERY_CODE:
  {
    if (resultCode == RESULT_OK && null != data) {
      try {
        String type = getFileExtension(data.getData());
        Bitmap bmp = MediaStore.Images.Media.getBitmap(getContentResolver(),data.getData());
        ByteArrayOutputStream baos = new ByteArrayOutputStream()
        bmp.compress(Bitmap.CompressFormat.JPEG,options,baos);;
        byte[] byteArray = baos.toByteArray();
        SendUploadRequest(byteArray,type);
      } catch(Exception e) {
        e.printstacktrace();
      }
    }
    break;
  }

一切正常,并将图像上传到服务器。 我想在选择图像时,用户必须选择自己的图像区域并将其裁剪为400 * 400,并将裁剪后的图像发送到服务器。 谢谢 更多细节:

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)