1. Mass compression bmp.compress ()
This compression method is called mass compression because it does not reduce the pixels of the picture. It is to keep pixels in the premise of changing the image of the bit depth and transparency, to achieve the purpose of compressing the picture. In the compressed image file size will change, but import into bitmap after the memory is unchanged. Because you want to keep the pixel constant, it cannot be compressed indefinitely, and after reaching a value it will not continue to become smaller. Obviously this method does not apply to the thumbnail, in fact, it is not suitable for compressing the image to reduce the application of memory, only for want to ensure the quality of the picture while reducing the file size.
2. Size Compression bitmapfactory.options-----options.insamplesize
Because the sampling rate (insamplesize) is an integer, and the suggestion is a multiple of 2, it is not very good to guarantee the quality of the picture. If we need to be between 2 and 3 sample rate, with 2, the picture is a little bigger, but with 3, the picture quality will be a significant decline. And that doesn't exactly meet my needs. However, the advantage of this method is to greatly reduce the use of memory, in the read memory on the picture, if you do not need high-definition effect, you can read only the edge of the picture, the width and height of the sample rate and then load the picture, so that it does not occupy too much memory.
Question
600 * 900 How to compress the image into the * * +???
Compress the insamplesize to the appropriate size first and then to JNI.
Compression of Android Images