Code example for Shape

Methods: draw

0
            strokepaint.setColor(stroke);
        } 
 
        protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
            // V1 
            shape.draw(canvas, fillpaint);
            shape.draw(canvas, strokepaint);
 
            // V2 
            // shape.resize(canvas.getClipBounds().right, 
            // canvas.getClipBounds().bottom); 
            // shape.draw(canvas, fillpaint); 
            // 
            // Matrix matrix = new Matrix(); 
            // matrix.setRectToRect(new RectF(0, 0, 
            // canvas.getClipBounds().right, canvas.getClipBounds().bottom), new 
            // RectF(strokeWidth / 2, strokeWidth / 2, 
            // canvas.getClipBounds().right - strokeWidth 
            // / 2, canvas.getClipBounds().bottom - strokeWidth / 2), 
            // Matrix.ScaleToFit.FILL); 
            // canvas.concat(matrix);