Code example for Paint

Methods: setAntiAlias, setColor, setStrokeWidth, setTextSize

0
    } 
 
    /** @see android.view.View#onDraw(android.graphics.Canvas) */ 
    @Override 
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setAntiAlias(true);
 
        effect.setEffect(paint);
        paint.setColor(Color.DKGRAY);
 
        paint.setStrokeWidth(5);
        canvas.drawLine(20, 10, 140, 20, paint);
 
        paint.setTextSize(26);
        canvas.drawText("Android", 40, 50, paint);
 
        // create a new Paint to draw the widget structure 
        paint = new Paint();
        paint.setColor(Color.BLACK);
        canvas.drawText(String.valueOf(id), 2.0F, 12.0F, paint);