tags:

views:

85

answers:

1

I have an ImageView from which I want to copy a piece of it in the shape of a circle that I can then re-display to the user at a larger than original size to simulate a zoom effect. Would I use bitmaps for that? Thanks.

A: 

Yes.... you can try to get a Bitmap that represents the ImageView you are working with. Before, you have to enable the caching (by invoking the setDrawingCacheEnabled(true) method). To get the Bitmap representation of the image, you can use the getDrawingCache() method.

Once you get that Bitmap, you can resize it or make any other changes you want. Then, you can create a Rect object with the portion of the bitmap you want to draw, then you draw that rect using this method: drawBitmap(Bitmap, Rect origin, Rect destination, Paint).

Cristian