首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android:保存bit地图

2013-03-25 
android:保存bitmap直接看代码吧:/** * 保存图片 * @param mSignBitmap * @param _path 图片保存路径 * @r

android:保存bitmap

直接看代码吧:

/** * 保存图片 * @param mSignBitmap * @param _path 图片保存路径 * @return */public static boolean createFile(Bitmap mSignBitmap,String _path) {ByteArrayOutputStream baos = null;try {baos = new ByteArrayOutputStream();mSignBitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);byte[] photoBytes = baos.toByteArray();if (photoBytes != null) {new FileOutputStream(new File(_path)).write(photoBytes);}return true;} catch (IOException e) {e.printStackTrace();} finally {try {if (baos != null)baos.close();} catch (IOException e) {e.printStackTrace();}}return false;}

?

热点排行