Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to crop a large image on android without loading into memory?

I don't want to display the bitmap on the screen. Just trying to create a max square image out of the original image from sdcard and then uploading to server. Is there a way to crop an image without loading the image into memory? or load the image in chunks and then save to file?

like image 775
Saqib Avatar asked Jul 13 '12 22:07

Saqib


People also ask

How do I crop a picture without losing it size?

One way to do this is to use a program like Photoshop. With Photoshop, you can resize an image without losing quality by using the "Image Size" dialog box. In the "Image Size" dialog box, you can change the width and height of the image. You can also change the resolution.


1 Answers

I don't know if I understand well the question but this could help:

http://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html

BitmapRegionDecoder can be used to decode a rectangle region from an image. BitmapRegionDecoder is particularly useful when an original image is large and you only need parts of the image.

Hope to help :)

like image 54
Litus Avatar answered Oct 12 '22 22:10

Litus