加载大容量图片:使用bitmap
public class MainActivity extends Activity {
private ImageView iv ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
iv = (ImageView) findViewById(R.id.iv) ;
}
public void loadImage(View view){
Bitmap bitmap = BitmapFactory.decodeFile("/mnt/sdcard/yazi.bmp") ;
iv.setImageBitmap(bitmap) ;
}
}
本文出自 “android笔记” 博客,请务必保留此出处http://2585211.blog.51cto.com/10044233/1671443
原文地址:http://2585211.blog.51cto.com/10044233/1671443