/**
  * 重载loadBitmap
  * @param res
  * @param id
  * @return
  */
 public static Bitmap loadBitmap(Resources res,int id){

  BitmapFactory.Options opt = new BitmapFactory.Options();
  opt.inPreferredConfig = Bitmap.Config.RGB_565;
  opt.inPurgeable = true;
  opt.inInputShareable = true;
  
  InputStream is = res.openRawResource(id);// 获取资源图片
  return BitmapFactory.decodeStream(is, null, opt);
  
 }
 /**
  * 处理图片加载方式可以避免内存溢出
  * 以最省内存的方式读取本地资源的图片
  * dezhengzhou
  * 12、3、30
  */
 public static Bitmap loadBitmapforoptions(Context context,int id){
   InputStream is = context.getResources().openRawResource(id);
      BitmapFactory.Options options=new BitmapFactory.Options();
      options.inJustDecodeBounds = false;
      options.inSampleSize = 2;   //width,hight设为原来的十分一
      Bitmap btp =BitmapFactory.decodeStream(is,null,options);
  return btp;
  
 }

上面写了两个类。

Bitmap oneButtonBitmap ;

oneButtonBitmap = Util.loadBitmap(
    BaseControl.mContext, R.drawable.select_point_one);