Slide 36
Slide 36 text
BitmapShader
public static Bitmap shader(Bitmap src) {
int width = src.getWidth();
int height = src.getHeight();
#
bitmap = Bitmap.createBitmap(width, height, config);
#
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
paint.setAntiAlias(true);
BitmapShader shader = new BitmapShader(
src, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
#
paint.setShader(shader);
RectF rectF =
new RectF(margin, margin, width - margin, height - margin);
canvas.drawRoundRect(recfF, radius, radius, paint);
#
return bitmap;
}