【发布时间】:2020-05-30 07:24:08
【问题描述】:
我在android studio中通过位图将图像发送到服务器:
bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), resultUri);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap = Bitmap.createScaledBitmap(bitmap , 500, 500, true);
bitmap .compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] imageBytes = baos.toByteArray();
String encodedImage = Base64.encodeToString(imageBytes, Base64.DEFAULT);
现在在世博会上我有 uri 使用图像选择器,我该如何在反应世博中做到这一点?
【问题讨论】:
标签: react-native bitmap expo imagepicker