Nik*_*hil 8 java android paint android-canvas
如何在画布上绘制文本,如下图所示Green rectangle.

我已经完成了以下代码....但是从这段代码我可以写入文本straight.不能写文字angle.
Bitmap bmpLayered = Bitmap.createBitmap(bmpMain.getWidth(), bmpMain
.getHeight(), Bitmap.Config.ARGB_8888);
Canvas cv = new Canvas(bmpLayered);
Paint charPaint = new Paint();
charPaint.setAntiAlias(true);
charPaint.setStyle(Paint.Style.FILL);
charPaint.setTextSize(24);
charPaint.setColor(Color.BLACK);
charPaint.setStrokeWidth(3);
cv.drawText("None", 570, 222, charPaint);
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题.
谢谢.
Orl*_*mee 26
cv.save();
cv.rotate(-45, x, y);
cv.drawText("your text here", x, y, paint);
cv.restore();
Run Code Online (Sandbox Code Playgroud)
其中cv是对画布的引用,x&y是你想要绘制的点.