Created
November 11, 2013 06:53
-
-
Save kyze8439690/7408999 to your computer and use it in GitHub Desktop.
fix android 2.3 can't decode bitmap in rgba8888 format
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
public static Bitmap convert(Bitmap bitmap, Bitmap.Config config) { | |
Bitmap convertedBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), config); | |
Canvas canvas = new Canvas(convertedBitmap); | |
Paint paint = new Paint(); | |
paint.setColor(Color.BLACK); | |
canvas.drawBitmap(bitmap, 0, 0, paint); | |
return convertedBitmap; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment