Slide 23
Slide 23 text
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
Custom Drawable
public
class
RoundCornersDrawable
:
Drawable
{
public
RoundCornersDrawable
(Bitmap
bitmap,
float
cornerRadius
=
5)
{
this.cornerRadius
=
cornerRadius;
this.paint
=
new
Paint
()
{
AntiAlias
=
true
};
var
tileMode
=
Shader.TileMode.Clamp;
paint.SetShader
(new
BitmapShader
(bitmap,
tileMode,
tileMode));
}
public
override
void
Draw
(Canvas
canvas)
{
canvas.DrawRoundRect
(rect,
cornerRadius,
cornerRadius,
paint);
}
}