Code example for Paint

Methods: set

0
 
        shape = new OvalShape();
        shape.resize(50, 50);
 
        myShapeDrawable = new ShapeDrawable(shape);
        myShapeDrawable.getPaint().set(paint);
        myShapeDrawable.setBounds(125, 225, 275, 375);
 
        setContentView(new MyView(this));
    } 
 
    /* Our custom view which will draw the drawable */ 
    private class MyView extends View {
 
        public MyView(Context context) {
            super(context);
        } 
 
        @Override 
        protected void onDraw(Canvas canvas) {
            myShapeDrawable.draw(canvas);