paint - How do I make a pattern fill of the path of a text in android? -
i trying generate below effect programmatically altering between 2 states on time
basically in first image (state #1), want path of text filled own custom bitmap (a red circle in case of example above) , should repeat after fixed distance (which happens same diameter of red circle in case). in second image (state #2), red circles take alternative pattern , locations blank spaces in state #1.
from the answer question gather can use bitmapshaders
on paint. following code have come 1 state. stuck , unable think how can achieve this.
public void drawtext(string text, int x, int y) { paint defpaint = new paint(); defpaint.settextsize(100); defpaint.setstrokewidth(0); defpaint.setstyle(style.fill_and_stroke); defpaint.setshader(new bitmapshader( ((androidpixmap) assets.redcircle).bitmap, tilemode.repeat, tilemode.repeat)); path path = new path(); defpaint.gettextpath(text, 0, text.length(), x, y, path); canvas.drawpath(path, defpaint); }
i have tried using patheffects
have not been successful them either.
Comments
Post a Comment