How can i draw text on canvas as shown in below image highlighted in Green rectangle
.
I have done following code.... but from this code i can write text in straight
. can't write text at 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);
Please help me to solve this.
Thanks.
cv.save();
cv.rotate(-45, x, y);
cv.drawText("your text here", x, y, paint);
cv.restore();
where cv being reference to your canvas, x & y the point where you want to draw.