Search code examples
androidandroid-imageview

Snapshot of imageview which have image


I am using imageview with rotating and zooming the image in imageview by two fingers. when i zoom the image its zooming i want part of image which is seen on imageview currently after zooming How can i do this please help me for this is it possible to take snapshot of that imageview of that time instant.


Solution

  • Perhaps the following, where v1 is your ImageView, and the body here would be called from some 'capture' button.

    v1.setDrawingCacheEnabled(true);
    bitmap = Bitmap.createBitmap(v1.getDrawingCache());
    

    Source: here.