Get the bitmap to zoom out.
Obitmap = Bitmapfactory.decoderesource (This.getresources (), r.drawable.ic_launcher);
Obitmap1 = Bitmapfactory.decoderesource (This.getresources (), R.drawable.cazhao);
Zooming in and out
Bitmap = a (Obitmap);
Bitmap1 = A (OBITMAP1);
// -----------
IV = (ImageView) Findviewbyid (R.id.imagev);
Iv1 = (ImageView) Findviewbyid (R.ID.IMAGEV1);
Iv.setimagebitmap (bitmap);
Iv1.setimagebitmap (BITMAP1);
Public Bitmap A (Bitmap OBP) {
Bitmap Rbitmap;
Full Screen high
WindowManager wm = (WindowManager) This
. Getsystemservice (Context.window_service);
The new picture is high and you can set it yourself. I am proportionally, take pictures of the high.
int ny = Wm.getdefaultdisplay (). GetHeight ()/8;
The height of the source picture
int oy = Obp.getheight ();
Here we calculate the scale of scaling, you can set the scale directly below CreateBitmap yourself
float c = ny * 1.0F/OY;
Matrix matrix = new Matrix ();
Matrix.prescale (c, c);
Get it out.
Rbitmap = Bitmap.createbitmap (OBP, 0, 0, Oy, Oy, Matrix, true);
return rbitmap;
}
Image zoom in and zoom in ImageView