In my application, I need to show navigation path between an array of points on ImageView
using Canvas
. I am able to draw a path on an ImageView
but I need to draw similar to this image:
Is it possible to draw a navigation path like this using Canvas
on ImageView
?
Please guide me on this concept.
Here is my code:
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.nipun_floor_temp);
imageView.setImageBitmap(bitmap);
Bitmap drawBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.RGB_565);
Canvas canvas = new Canvas(drawBitmap);
canvas.drawBitmap(bitmap, 0, 0, null);
// Line
Paint paint = new Paint();
paint.setColor(Color.BLUE);
paint.setStrokeWidth(15);
int startx = 340;
int starty = 103;
int endx = 340;
int endy = 503;
canvas.drawLine(startx, starty, endx, endy, paint);
imageView.setImageDrawable(new BitmapDrawable(getResources(), drawBitmap));