سؤال

Progress bar image

Hello cane someone help me please. I have bean trying for more than four hours to accomplish the following. I want the progress bar to display an image instead to display a color. I haven't found any tutorial about that?

هل كانت مفيدة؟

المحلول

You can create Paint object with bitmap shader:

paintImage = new Paint();
paintImage.setShader(new BitmapShader(bitmap, TileMode.CLAMP, TileMode.CLAMP));

and then draw with it like as you draw with usual color paint:

canvas.drawRect(new Rect(...), paintImage);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top