android 拍照后保存图片(2) onActivityResult
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Bundle extras = data.getExtras(); Bitmap b = (Bitmap) extras.get("data"); // img.setImageBitmap(b); if (b != null) { try { BufferedOutputStream bos = new BufferedOutputStream( new FileOutputStream(android.os.Environment .getExternalStorageDirectory() + "/a.jpeg")); b.compress(CompressFormat.JPEG, 75, bos); bos.flush(); bos.close(); } catch (Exception e) { e.printStackTrace(); } } }
相关推荐
zhangsunyucong 2015-10-26
ChaoYoung 2014-08-28
kiduo0 2014-06-03
woolnil 2012-02-28
yinbaoshiguang 2011-10-31
冰川孤辰 2011-10-09
yeaperyeo 2011-07-15
csdnuuu 2019-12-27
GoAheadY 2010-10-13
满城风絮 2011-06-19
guizhongyun 2014-12-27
cf 2012-12-05
Ifree团队 2011-10-30
思捻如枫 2011-08-19
ALDRIDGE 2011-02-23