Created
July 9, 2016 16:00
-
-
Save lidemin/7dc80a5ed49e7925a88c3c9253514ae5 to your computer and use it in GitHub Desktop.
Just for testing.
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
@Override | |
public synchronized Bitmap getMosaicTile(String hexColor, int tileWidth, int tileHeight) throws Exception { | |
Bitmap newBmp = Bitmap.createBitmap(tileWidth, tileHeight, Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(newBmp); | |
RectF rectF = new RectF(padding, padding, tileWidth - padding, tileHeight - padding); | |
paint.setColor(Color.parseColor("#" + hexColor)); | |
canvas.drawRoundRect(rectF, radius, radius, paint); | |
return newBmp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment