Canvas.drawTextOnPath 2D绘图

绘制文字效果,如下图
Canvas.drawTextOnPath 2D绘图

protected void onDraw(Canvas canvas) 
{ 
    Paint paint = new Paint(); 
    paint.setTextSize(20); 
    Path path = new Path(); 
    //  绘制一个圆形的路径,文字会在该圆的上边缘外侧绘制 
    path.addCircle(100,100, 100, Direction.CW); 
    canvas.drawColor(Color.WHITE); 
    canvas.translate(50, 50); 
    paint.setTextAlign(Paint.Align.RIGHT); 
    canvas.drawTextOnPath("Android 开发权威指南", path, -55,0, paint); 
} 

你可能感兴趣的:(2D绘图)