//从资源中获取BitmapResources res = getResources(); Bitmap bmp = BitmapFactory.decodeResource(res, R.drawable.icon);//Bitmap → byte[]public byte[] Bitmap2Bytes(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(希望对你有用