示例#1
0
        public void FillRectangle(Rect rect, Brush brush)
        {
            var paint = new Paint();

            paint.Color = brush.Color.ToAndroid();
            canvas.DrawRect(rect.ToAndroid(), paint);
        }
示例#2
0
        public void DrawRectangle(Rect rect, Pen pen)
        {
            var paint = new Paint();

            paint.Color = pen.Brush.Color.ToAndroid();
            canvas.DrawRect(rect.ToAndroid(), paint);
        }
示例#3
0
        public void FillRoundedRectangle(Rect rect, Brush brush, CornerRadius cornerRadius)
        {
            var paint = new Paint();

            paint.Color = brush.Color.ToAndroid();
            var rx = cornerRadius.BottomLeft;
            var ry = cornerRadius.BottomLeft;

            canvas.DrawRoundRect(rect.ToAndroid(), (float)rx, (float)ry, paint);
        }
示例#4
0
        public void DrawRoundedRectangle(Rect rect, Pen pen, CornerRadius cornerRadius)
        {
            var paint = new Paint();

            paint.SetStyle(Paint.Style.Stroke);
            paint.StrokeWidth = (float)pen.Thickness;
            paint.Color       = pen.Brush.Color.ToAndroid();
            var rx = cornerRadius.BottomLeft;
            var ry = cornerRadius.BottomLeft;

            canvas.DrawRoundRect(rect.ToAndroid(), (float)rx, (float)ry, paint);
        }