title: How to get scaled Bitmap from ImageView
body: <p>I am having a <code>Activity</code> which has a custom <code>ImageView</code> defined in the XML for Pinch Zoom functionality on an image. Now, my problem is that I want to fetch the scaled <code>Bitmap</code> from the Pinch Zoom functionality. For example if the user peforms zooming on the Image, then I want to store the exact size and the position of the Image as Bitmap. </p>
  
  <p>This is my custom ImageView declared in XML.</p>
  
  <pre><code>&lt;com.cam.view.PinchZoom_ImageView 
    android:id="@+id/gallery_selected_image_view"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:src="@drawable/icon"
    android:scaleType="center"
   /&gt;
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I am trying the below code to get the scaled Image, but It returns a Blank Bitmap.</p>
  
  <pre><code>        pinchZoom.setDrawingCacheEnabled(true);
          pinchZoom.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), 
                      MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
          pinchZoom.layout(0, 0, pinchZoom.getMeasuredWidth(), pinchZoom.getMeasuredHeight());
          pinchZoom.buildDrawingCache(true);
          Bitmap_gallery_Item = Bitmap.createBitmap(pinchZoom.getDrawingCache());
          pinchZoom.setDrawingCacheEnabled(false);
  </code></pre>
  
  <p>Any help would be appreciated. Thanks</p>