1.得到一个Bitmap对象
InputStream in = getResources().openRawResource(R.drawable.pic);
BitmapDrawable bd = new BitmapDrawable(in);
Bitmap b = bd.getBitmap();
2.把一个Bitmap对象写到磁盘里
OutputStream os = new FileOutputStream(pathName);
bitmap.compress(CompressFormat.PNG, 80, os);
os.flush();
os.close();