Resizable Rectangle Overlay on Touch in Android

When I read this question on StackOverFlow, I tried to develop a custom control overlay which behaves like it.

Read this article to make your own resizable rectangle overlay on touch in Android. This will help you in Image or map application.


rectangle overlay

Download Source :

Step 1

Create a package called “customview” in your application and paste following class in it.

Below class holds image, points (location) of 4 corners.

Step 2

We have created a class which holds corners information and image. But to handle those corners, we need to implement that ColorBall objects in another class called “DrawView”. Copy/Paste below code in same package “customview”.

Thats it!!!

To use custom control in your application, write following code in your layout file.

You can do some more research and implementation to add more functionality to this overlay.

Share on Facebook0Share on Google+2Tweet about this on TwitterShare on LinkedIn0Share on Reddit0Pin on Pinterest0Share on Tumblr0Email this to someone