Reputation: 8608
I'm trying to find a way to implement a shape (a rectangle) that can be moved over an image. The user would drag the rectangle to an area in the image, as to eventually select it.
How can this be done? What should I use? Any help would be appreciated!
Upvotes: 1
Views: 125
Reputation: 1746
Use canvas
choosenImageView = (ImageView) this.findViewById(R.id.ChoosenImageView);
canvas = new Canvas(bitmap); //Bitmap
mBitmapPaint = new Paint();
mBitmapPaint.setAntiAlias(true);
mBitmapPaint.setStyle(Paint.Style.STROKE);
mBitmapPaint.setStrokeWidth(5);
choosenImageView.setOnTouchListener(this);
Upvotes: 1