android - Uneven line width in drawn stroke rectangle -
i need draw stroke rectangle rounded corners. here code:
mlinepaint = new paint(); mlinepaint.setcolor(mdotcolortouched); mlinepaint.setantialias(true); mlinepaint.setstrokewidth(mlinewidth); mlinepaint.setstyle(paint.style.stroke); mlinepaint.setstrokecap(paint.cap.round); bitmap = bitmap.createbitmap(300, 300, bitmap.config.argb_8888); canvas c = new canvas(bitmap); rectf r = new rectf(0, 0, 300 , 300); c.drawroundrect(r, 30, 30, mlinepaint); but can see line width bigger in corners... idea why happens , how fix this?
try set of code it's working.
paint paint = new paint(); paint.setstyle(paint.style.stroke); paint.setcolor(color.blue); paint.setstrokewidth(10); bitmap b = bitmap.createbitmap(300, 300, bitmap.config.argb_8888); canvas c = new canvas(b); rectf rectf = new rectf(); rectf.set(5,5,250,250); c.drawroundrect(rectf, 10, 10, paint); imgview.setimagebitmap(b); 

Comments
Post a Comment