Last active
August 29, 2015 14:05
-
-
Save weitsai/80b1dd8050cac64a1b64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bitmap bitmap = Media.getBitmap(mContext.getContentResolver(), data.getData()); | |
Matrix vMatrix = new Matrix(); | |
int newWidth = 200; | |
float scaleWidth = newWidth / bitmap.getWidth(); | |
int newHeight = 200; | |
float scaleHeight = newHeight / bitmap.getHeight(); | |
vMatrix.postScale(scaleWidth, scaleHeight); | |
Bitmap newBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), vMatrix, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment