Android bitmap compress code

With the development of mobile phone hardware, Android's camera function becomes more and more powerful, which can find high-resolution pictures. In some scenarios, you need to take photos and upload them to the service, but because the size of the picture is too large, the upload will be very slow (in some network cases) and consume a lot of traffic. In order to speed up, you need to reduce the size of the picture. There are two ways to reduce the size of the picture: 1. Take a small picture; 2. Compress large pictures. Obtaining small pictures during photography generally does not meet the requirements, because the picture definition will be very poor, but one advantage of this situation is that the application speed will be faster; Compressing a picture is to compress a large picture to a small size, reduce the quality of the picture, reduce the size of the picture within a certain range, and meet the needs (the picture is still clear). The following group describes image compression:

1. Please check for photos http://www.jb51.net/article/37760.htm ->If you want to save the pictures to the specified directory, you need to specify the file when starting the camera application. 2. Compression process: 2.1 read the pictures from the picture path (the pictures are large and cannot be added to memory for processing. If they are all loaded into memory, memory overflow will occur) [Java]

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>