I just want to open my own application for the camera from my application, to take a picture and set it as the background image of my screen, and then turn it on the click button. A photo rotates n times if it is taken with a 3 megapixel camera. If I set the camera resolution to 5 or more points, the application will be forced to close when the button is pressed 5 times (the photo rotates 4 times).
Bitmap rotatedBitmap = null; int curAngle = 0; private Bitmap rotateImageBitmap(Bitmap capturedPhotoBitmap) { if(rotatedBitmap != null ) { rotatedBitmap = null; } Matrix matrix = new Matrix(); curAngle = (curAngle + 90) % 360; matrix.postRotate(curAngle); rotatedBitmap = Bitmap.createBitmap(capturedPhotoBitmap, 0, 0, capturedPhotoBitmap.getWidth(), capturedPhotoBitmap.getHeight(), matrix, true); return rotatedBitmap; }
This is from the developer's guide ....
1. Mobile devices usually have limited system resources. Android devices can have only 16 MB of memory for one application.
2. Raster images take up a lot of memory, especially for rich images such as photographs. For example, a camera on a Galaxy Nexus takes photos up to 2592x1936 pixels (5 megapixels) in size. If the raster configuration ARGB_8888 is used (by default, it is further from Android 2.3), then loading this image into memory takes about 19 MB of memory (2592 * 1936 * 4 bytes), immediately having exhausted the restriction for each application on some devices.
Most phones currently have 8 megapixels or larger cameras. so the pictures will be large. How can I rotate my photo ānā several times without worrying about camera resolution. Do I need to squeeze it? What is the best way? Please help me.
source share