Fork me on GitHub
摘要: 从网络获取图片,数据为InputStream流对象,然后调用BitmapFactory的decodeStream()方法解码获取图片。代码如下:private Bitmap getUrlBitmap(String url) { Bitmap bm; try{ URL imageUrl=new URL(url); HttpURLConnection conn=(HttpURLConnection)imageUrl.openConnection(); conn.connect(); InputStream is=conn.getInputStream(); //byte[] bt=getBytes 阅读全文
posted @ 2011-05-27 21:53 Greenwood 阅读(2587) 评论(0) 推荐(0) 编辑