如何从URL调整位图德codeD? [英] How to resize bitmap decoded from URL?

查看:121
本文介绍了如何从URL调整位图德codeD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用位图使用摆脱URL的图片的

I am using bitmap to get a image from a url using this

public void loadImage(String url){
try {

       bitmap = BitmapFactory.decodeStream((InputStream)new URL(url).getContent());

    } catch (MalformedURLException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }

}

反正我有可以从这里调整图片的大小?设置宽度和它仍然保持分辨率的高度?

Is there anyway i can resize the image from here? setting the width and the height of it still keeping the resolution?

推荐答案

使用: Bitmap.createScaledBitmap(位图SRC,诠释dstWidth,诠释dstHeight,布尔型过滤器)

这篇关于如何从URL调整位图德codeD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆