課程
/移動(dòng)開發(fā)
/Android
/Android圖像處理-打造美圖秀秀從它開始
老師你好,處理后的圖片怎么保存???怎么保存到本地呢?
2016-04-13
源自:Android圖像處理-打造美圖秀秀從它開始 3-2
正在回答
private?void?saveBitmap(Bitmap?bitmap,String?path,String?imageName){ ????String?fileName=null;//?照片完整路徑?? ????if(bitmap!=null){ ????????FileOutputStream?fos=null; ????????File?file=new?File(path); ????????file.mkdirs(); ????????fileName=path+imageName; ????????try{ ????????fos?=?new?FileOutputStream(fileName); ????????bitmap.compress(Bitmap.CompressFormat.JPEG,?90,?fos); ????????}catch(FileNotFoundException?e){ ????????e.printStackTrace(); ????????}finally?{ ????try?{ ????????fos.flush(); ????????fos.close(); ????}?catch?(IOException?e)?{ ????????e.printStackTrace(); ????} } ????} }
舉報(bào)
圖像色彩的分析與處理,演示市面上常見的圖像處理特效的實(shí)現(xiàn)方法
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-05-11