如何使从相机拍摄的照片的缩略图? [英] How to make a thumbnail from a photo taken from camera?

查看:221
本文介绍了如何使从相机拍摄的照片的缩略图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我使用的外接摄像头的应用程序,以使照片并保存到SD卡,我需要这个照片的缩略图广场。我已经成功地裁剪方通过相机的意图发回的缩略图,但因为我的照片保存到磁盘,目的是空的,我的老方法,使画面方位图裁剪= Bitmap.createBitmap(源,0,0,分,分)抛出OutOutMemory异常。


解决方案

 位图ThumbImage = ThumbnailUtils.extractThumbnail(BitmapFactory.de codeFILE(的ImagePath),THUMBSIZE,THUMBSIZE);

In my app I'm using external camera app to make photo and save it to sdcard, and I need a square thumbnail of this photo. I've managed to crop to square the thumbnail sent back by camera in the intent, but since i'm saving photo to disk, the intent is empty, and my old method to make picture square Bitmap cropped = Bitmap.createBitmap(source, 0, 0, min, min) throws an OutOutMemory exception.

解决方案

Bitmap ThumbImage = ThumbnailUtils.extractThumbnail(BitmapFactory.decodeFile(imagePath), THUMBSIZE, THUMBSIZE);

这篇关于如何使从相机拍摄的照片的缩略图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆