您的位置:首页 > 移动开发 > Android开发

android 存储图片到data目录和读取data目录下的图片

2011-12-05 14:07 525 查看
存储图片代码:String str1 = "icon.png";

FileOutputStream localFileOutputStream1 = openFileOutput(str1, 0);

Bitmap.CompressFormat localCompressFormat = Bitmap.CompressFormat.PNG;

bitmap.compress(localCompressFormat, 100, localFileOutputStream1);

localFileOutputStream1.close();

读取图片代码:

String localIconNormal = "icon.png";

FileInputStream localStream = openFileInput(localIconNormal);

Bitmap bitmap = BitmapFactory.decodeStream(localStream));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  存储 android string
相关文章推荐