bitmap - Android: BitmapDrawable.Draw(Canvas) Doesn't seem to work -


i trying tile 20x20 background onto custom view reason unable too.

    bitmapdrawable background;     background = new bitmapdrawable(bitmapfactory.decoderesource(getresources(), r.drawable.back));     background.settilemodexy(shader.tilemode.repeat, shader.tilemode.repeat);     background.draw(canvas); 

does have idea why isn't working?

you can use bitmapdrawable, have set bounds first knows how tiling do:

bitmapdrawable background; background = new bitmapdrawable(bitmapfactory.decoderesource(getresources(),r.drawable.back));  //in case, want tile entire view background.setbounds(0, 0, myview.getwidth(), myview.getheight());  background.settilemodexy(shader.tilemode.repeat, shader.tilemode.repeat); background.draw(canvas); 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -