You need to create a custom ImageView class to achieve scaling and panning of the image and may have a fixed image(transparent) rectangle superimposed on that image. And can create a sub-image of this bitmap. and save it to a file.
createBitmap(Bitmap source, int x, int y, int width, int height);
This method is used to create a beat map.
http://blog.sephiroth.it/2011/04/04/imageview-zoom-and-scroll/
After achieving zooming and panning, I'm not sure that createBitmap can create a sub-image from the visible part of the image (i.e., part of the image will not be visible on the screen when it is enlarged). So try to get drawingCache() from ImageView and create a padded image for the same.
source share