Esempio n. 1
0
 public void resetView(Bitmap b) {
   setImageBitmap(b);
   setImageBitmapResetBase(b, true);
   setImageMatrix(getImageViewMatrix());
   int width = mBitmapDisplayed.getWidth();
   int height = mBitmapDisplayed.getHeight();
   Rect imageRect = new Rect(0, 0, width, height);
   int cropWidth = Math.min(width, height) * 4 / 5;
   int cropHeight = cropWidth;
   int x = (width - cropWidth) / 2;
   int y = (height - cropHeight) / 2;
   RectF cropRect = new RectF(x, y, x + cropWidth, y + cropHeight);
   HighlightView hv = new HighlightView(this);
   hv.setup(getImageViewMatrix(), imageRect, cropRect, false, true);
   hv.setFocus(true);
   add(hv);
   centerBasedOnHighlightView(hv);
   hv.setMode(HighlightView.ModifyMode.None);
   center(true, true);
   invalidate();
 }