Code example for Bitmap

Methods: copyPixelsToBuffergetHeightgetWidthrecycle

0
	         * AndroidManifest.xml file 
	         */ 
	       RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw");
 
	        // get the width and height of the source bitmap. 
	        int width = bitmap.getWidth();
	        int height = bitmap.getHeight();
 
	        // Copy the byte to the file 
	        FileChannel channel = randomAccessFile.getChannel();
	        MappedByteBuffer map = null;
	        if(reduceColor){
	        	map = channel.map(MapMode.READ_WRITE, 0, width * height *2);
	        }else{ 
	        	map = channel.map(MapMode.READ_WRITE, 0, width * height *4);
	        } 
	        bitmap.copyPixelsToBuffer(map);
	        bitmap.recycle();
	        bitmap = null;
 
	        if(reduceColor){
	        	mutable = Bitmap.createBitmap(width, height, Config.RGB_565);
	        }else{ 
Connect your IDE to all the code out there  Get Codota for Java