I am trying to draw a rounded line of a specific width on my imageView Bitmap.
So I drew a simple line with paintLine.strokeCap = Paint.Cap.ROUND and without this option.
Here is the result :
The first one is rounded and you can see it's larger than the bottom one.
Here is the code I use.
val paintLine = Paint()
paintLine.color = Color.WHITE
paintLine.style = Paint.Style.FILL_AND_STROKE
paintLine.strokeWidth = 40.0f
paintLine.strokeCap = Paint.Cap.ROUND
val workingBitmap = Bitmap.createBitmap(bitmap)
val mutableBitmap = workingBitmap.copy(Bitmap.Config.ARGB_8888, true)
val drawingBitmapCanvas = Canvas(mutableBitmap)
drawingBitmapCanvas.apply {
drawLine(300, 300, 400, 300, paintLine)
}
I would like to know if there is a way to keep the same width with rounded line ?
Thanks.

