androidoverlayandroid-custom-viewpinchzoomtouchimageview

Add OverlayView on ImageView in Android at particular X-Y Co-ordinate


I have back side TouchImageview, which having zoom in/out functionality, I am setting up bitmap on ImageView, the size of Bitmap is w-h (2100 x 2900), I have particular X-Y co-ordinate, now I want to add Overlay view at same co-ordinate as per imageview's X-Y co-ordinate, the background imageview should be touchable.

Can you please let me know solution for the same.

Thank you.

enter image description here


Solution

  • I'm an iOS developer, but can be answer to your question, as I'm sure that these things are also possible in Android ! ;)

    You can follow these steps:

    1. Don’t make any change in your current flow.
    2. Add overlay view the way you want.
    3. Take screenshot of the back image view which are showing location, may be of particular size (or the exact size of circle on overlay).
    4. Show that captured screenshot (image) at circle view position (you can have an another image view for that).
    5. Zoom that image view (From Step.4)
    6. You are done!

    Goodluck.