Question

First off, I don't want to zoom into a particular region of the image. I want the image to just get bigger, and when it gets too big for the screen, I just want the parts too big for the screen to just fall off the edges (essentially, the parts that don't fit on the screen will just not be visible). Any ideas on how to do this?

Was it helpful?

Solution

Set the ImageView.ScaleType to MATRIX and then supply an appropriate matrix to do the scaling.

ImageView iv;

iv.setScaleType(ScaleType.MATRIX);
//New matrix is identity matrix
Matrix m = new Matrix();
/*
 * Scale to 2x in both directions.
 * There is also a version that takes a pivot point if you want
 * to set the scale's point of origin.
 */
m.postScale(2.0f, 2.0f);

iv.setImageMatrix(m);

HTH

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top