Code example for Bitmap

Methods: getConfiggetHeightgetRowBytesgetWidth

			// android:name="android.permission.WRITE_EXTERNAL_STORAGE" 
			// into AndroidManifest.xml file 
			RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw");
			// get the width and height of the source bitmap. 
			int width = original.getWidth();
			int height = original.getHeight();
			Config type = original.getConfig();
			// Copy the byte to the file 
			// Assume source bitmap loaded using options.inPreferredConfig = 
			// Config.ARGB_8888; 
			FileChannel channel = randomAccessFile.getChannel();
			MappedByteBuffer map =, 0,
					original.getRowBytes() * height);
			// recycle the source bitmap, this will be no longer used. 
			System.gc();// try to force the bytes from the imgIn to be released
			original = null;