摘要: 在通过BitmapFactory.decodeFile(String path)方法将突破转成Bitmap时,遇到大一些的图片,我们经常会遇到OOM(Out Of Memory)的问题。怎么避免它呢? 这就用到了我们上面提到的BitmapFactory.Options这个类。BitmapFactory.Options这个类,有一个字段叫做inJustDecodeBounds。SDK中对这个成员的说明是这样的: If set to true, the decoder will return null (no bitmap), but the out… 也就是说,如果我们把它设为true,那么Bi 阅读全文
posted @ 2014-03-06 17:31 Yang2 阅读(1894) 评论(0) 推荐(2) 编辑
摘要: 系统已经有的东西,如果我们没有新的需求的话,直接调用是最直接的。下面讲讲调用系统相机拍照并保存图片和如何调用系统相册的方法。首先看看调用系统相机的核心方法:Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);startActivityForResult(camera, 100);相机返回的数据通过下面的回调方法取得,并处理@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActiv. 阅读全文
posted @ 2014-03-06 17:19 Yang2 阅读(1752) 评论(0) 推荐(2) 编辑