【发布时间】:2015-09-06 23:06:22
【问题描述】:
我将图像存储在 Amazon S3 上。我使用以下代码从 Amazon S3 下载图像
S3ObjectInputStream content = s3Client.getObject("bucketname", url).getObjectContent();
byte[] bytes ;
bytes = IOUtils.toByteArray(content);
bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
bitmap = Bitmap.createScaledBitmap(bitmap, width, height, true);
bitmap = CommonUtilities.getRoundedCornerBitmap(bitmap, 30);
cache.put(url, new SoftReference<Bitmap>(bitmap));
return bitmap;
在浏览毕加索文档时,我读到了加载我们只需要做的图像
Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);
那么如何通过 Picasso 下载 Amazon S3 图像。
【问题讨论】:
-
您没有对任何答案投赞成票。您是否认真使用 SO 并帮助他人?我们不知道什么对你有用..
标签: android amazon-web-services amazon-s3 picasso