Merge two / more images in Android (widget)

Trying to create a widget with custom fonts, but read that the widget does not support custom fonts.

I thought I could create 10 png for each number (0-10 without using abcctct).

Using this method, I need to create several images. This seems like a waste of views.

So, if I want to have the number 1337, I need 4 ImageViews. Isn't there a way to merge png (R.drawable), so I get a bitmap or something else and only one ImageView?

+3
source share
1 answer

drawable (extends Drawable), (.. ), .

public void draw(Canvas canvas) {
   ....
   // use this to place another bitmap, i.e. number images, onto the canvas
   canvas.drawBitmap(..,..,..);  
   ...
}

drawable, .

0

Source: https://habr.com/ru/post/1760265/


All Articles