Code example for Canvas

Methods: drawOval, restore, rotate, save

0
         * angles less than or greater than 0 radians rotate the major axis left or right. 
         */ 
        private final RectF mReusableOvalRect = new RectF();
        private void drawOval(Canvas canvas, float x, float y, float major, float minor,
                float orientation, Paint paint) {
            canvas.save(Canvas.MATRIX_SAVE_FLAG);
            canvas.rotate((float) (orientation * 180 / Math.PI), x, y);
            mReusableOvalRect.left = x - minor / 2;
            mReusableOvalRect.right = x + minor / 2;
            mReusableOvalRect.top = y - major / 2;
            mReusableOvalRect.bottom = y + major / 2;
            canvas.drawOval(mReusableOvalRect, paint);
            canvas.restore();
        } 
 
        /** 
         * Splatter paint in an area. 
         * 
         * Chooses random vectors describing the flow of paint from a round nozzle 
         * across a range of a few degrees.  Then adds this vector to the direction 
         * indicated by the orientation and tilt of the tool and throws paint at