如何减小.png图像的大小?
将文件从drawable中复制到外部位置也会使文件大小增加5至10倍。
以下是一些相关的it技术:
bm.compress(Bitmap.CompressFormat.PNG, 50, out);
//在这里,由于PNG是无损的,50不起作用
Bitmap bm=BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher);
String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
File file = new File(extStorageDirectory, "ic_launcher.PNG");
outStream = new FileOutputStream(file);
bm.compress(Bitmap.CompressFormat.PNG, 100, outStream);
outStream.flush();
outStream.close();