1
我开始构建一款游戏,这款游戏从服务器获取图片。图片来自URL
我用位图转换图像* S *及其作品缓慢。
及其采取25 - 40秒的负载22倍的图像(100KB为每个图像)。
public static Bitmap getBitmapFromURL(String src) {
try {
URL url = new URL(src);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(input);
return myBitmap;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
实现:
Bitmap pictureBitmap = ImageFromUrl.getBitmapFromURL(path);
PS ..
我之前使用LazyList,这不是我的目标。
更多供应信息?
TNX ....
你可以参考这个链接http://stackoverflow.com/questions/2471935/how-to-load-an-imageview-by-网址功能于安卓 –