你也可以沿着某条Path来绘制这些文字:
Path path = new Path(); path.moveTo(50,50); path.lineTo(100, 100); path.lineTo(200, 200); path.lineTo(300, 300); path.close(); canvas.drawTextOnPath(最喜欢看曹神日狗了~, path, 50, 50, mPaint); //绘制文字 10)绘制自定义的图形:代码来源于网上:
protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.translate(canvas.getWidth()/2, 200); //将位置移动画纸的坐标点:150,150 canvas.drawCircle(0, 0, 100, mPaint); //画圆圈 //使用path绘制路径文字 canvas.save(); canvas.translate(-75, -75); Path path = new Path(); path.addArc(new RectF(0,0,150,150), -180, 180); Paint citePaint = new Paint(mPaint); citePaint.setTextSize(14); citePaint.setStrokeWidth(1); canvas.drawTextOnPath(绘制表盘~, path, 28, 0, citePaint); canvas.restore(); Paint tmpPaint = new Paint(mPaint); //小刻度画笔对象 tmpPaint.setStrokeWidth(1); float y=100; int count = 60; //总刻度数 for(int i=0 ; i://www.bkjia.com/Androidjc/1062896.htmlTechArticleAndroid基础入门教程——8.3.1 三个绘图工具类详解 上两小节我们学习了Drawable以及Bitmap,都是加载好图片的,而本节我们要学习的绘图相关的...