Use Bitmap.createScaledBitmap as others suggested.
However, this function is not very smart. If you're scaling to less than 50% size, you're likely to get this:
Instead of this:
Do you see bad antialiasing of 1st image? createScaledBitmap will get you this result.
Reason is pixel filtering, where some pixels are completely skipped from source if scaling to < 50%.
To get 2nd quality result, you need to halve the Bitmap's resolution if it's more than 2x larger than desired result, then finally you make call to createScaledBitmap.
And there're more approaches to halve (or quarter, or eighten) images. If you have Bitmap in memory, you recursively call Bitmap.createScaledBitmap to halve image.
If you load image from JPG file, implementation is even faster: you use BitmapFactory.decodeFile and setup Options parameter properly, mainly field inSampleSize, which controls subsambling of loaded images, utilizing JPEG's characteristics.
Many apps which provide image thumbnails use blindly Bitmap.createScaledBitmap, and the thumbnails are just ugly. Be smart and use proper image downsampling.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…