android - How can we specify the text size, type, density when creating bitmap -


i'm trying create bitmap text on it. i'm having troubles in specifying options text, size, type, smoothness.

here code:

bitmap resultbitmap=bitmap.createbitmap(384,384, bitmap.config.argb_8888); canvas canvas = new canvas(resultbitmap); canvas.drawcolor(color.white); paint paint = new paint(); paint.setcolor(color.black); // text color   paint.setstrokewidth(24); // text size       paint.setxfermode(new porterduffxfermode(porterduff.mode.src_over)); // text overlapping pattern  // more settings... canvas.drawbitmap(resultbitmap, 0, 0, paint); canvas.drawtext("00: text", 300, 10, paint); 

these options available in paint used draw text on canvas. check autocomplete on android studio. note color paints original color, there's no settextcolor method available. enter image description here


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -