2012-11-09 30 views

回答

0

一种选择,我可以建议ü,

URL url = new URL(urlString); //Convert url string to url object. 
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); 
connection.setDoInput(true); 
connection.connect(); 
InputStream input = connection.getInputStream(); 
Bitmap myImageBitmap = BitmapFactory.decodeStream(input); 
Bitmap resizedImage = Bitmap.createScaledBitmap(myImageBitmap, dstWidth, dstHeight, true); 
// dstWidth & dstHeight are the needed size of image. 

和关于屏幕大小,U可以通过重写View类,其中w & h为当前的宽度和屏幕的高度onSizeChanged (int w, int h, int oldw, int oldh)方法得到它。

相关问题