tags:

views:

387

answers:

2

Hi All, Can anybody help me to draw a scalable rectangle around a bitmap And such that 1) The rectangle should scale based on the size of my bitmap 2) The colour of my rectangle should change on my input any help would be appreciated Thank you

A: 

You can create class extending View, and override onDraw and onTouchEvent methods.

skyman
A: 

Paint paint = new Paint();

paint.setStyle(Paint.Style.FILL);

paint.setColor(Color.MAGENTA);

DashPathEffect dashPath =new DashPathEffect(new float[ ]{70,2}, 30);

        paint.setPathEffect(dashPath);
        paint.setStrokeWidth(80);
        canvas.drawLine(30, 300 , 320, 300, paint);