Created
December 13, 2012 08:10
-
-
Save sabadow/4274923 to your computer and use it in GitHub Desktop.
Image with rounded corners by Romain Guy
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
BitmapShader shader; | |
shader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); | |
Paint paint = new Paint(); | |
paint.setAntiAlias(true); | |
paint.setShader(shader); | |
RectF rect = new RectF(0.0f, 0.0f, width, height); | |
// rect contains the bounds of the shape | |
// radius is the radius in pixels of the rounded corners | |
// paint contains the shader that will texture the shape | |
canvas.drawRoundRect(rect, radius, radius, paint); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment