0

enter image description hereI am using Canvas to draw circles and lines. I want to display small circles inside the canvas in particular position. For that, i have created a circular drawable xml file and i have converted that xml into Bitmap and displaying over the Canvas and for that i am using canvas.drawBitmap() method.

But i want to display a textview inside that Bitmap but textview is getting displayed above that Bitmap using canvas.drawText(). I want to display the text inside the Bitmap.

2 Answers2

0

You can use TextDrawable library, and found it to be very useful.This light-weight library provides images with letter/text like the Gmail app.

It extends the Drawable class thus can be used with existing/custom/network ImageView classes. Also included is a fluent interface for creating drawables and a customizable ColorGenerator.

Click here for example on github

0

Forget Canvas, draw an xml. First convert text in svg on line i.e :

_ https://framavectoriel.org/ (only 4 police)

_ https://www.janvas.com/v6.1/janvas_app_6.1_public/index.html (not free)

Secondly, convert svg in xml here : http://a-student.github.io/SvgToVectorDrawableConverter.Web/

And then, you have your text in a bitmap

*If you don't know how to save the svg on framavectoriel.org, click on the button, copy the lines and save it with svg extension.

Nicoolasens
  • 2,871
  • 17
  • 22