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
Post a Comment