新浪微博 登陆  注册   设为首页 加入收藏

学PHP >> Android开发应用 >> android 图片加载方式

android 图片加载方式

查看次数2784 发表时间2013-06-04 23:36:34

//会缩放图片BitmapDrawable drawable = (BitmapDrawable)getResources().getDrawable(R.drawable.logo);Log.d("XX", drawable.getBitmap().getHeight() + " " + drawable.ge...
//会缩放图片
BitmapDrawable drawable = (BitmapDrawable)getResources().getDrawable(R.drawable.logo);
Log.d("XX", drawable.getBitmap().getHeight() + " " + drawable.getBitmap().getWidth());
//会缩放图片
Bitmap bitmap1 = BitmapFactory.decodeResource(getResources(), R.drawable.logo);
Log.d("XX", bitmap1.getHeight() + " " + bitmap1.getWidth());
//不会缩放图片
Bitmap bitmap2 = BitmapFactory.decodeStream(getResources().openRawResource(R.drawable.logo));
Log.d("XX", bitmap2.getHeight() + " " + bitmap2.getWidth());
//不会缩放图片
InputStream is = getResources().openRawResource(R.drawable.logo);  
BitmapDrawable bmpDraw = new BitmapDrawable(is);  
Bitmap bmp = bmpDraw.getBitmap();  
Log.d("XX", bmp.getHeight() + " " + bmp.getWidth());

(转发请注明转自:学PHP)    


  相关推荐




  发表评论
昵称:
(不超过20个字符或10个汉字)
内容: