0

首先,我不想放大图像的特定区域。我希望图像变得更大,当它对屏幕来说太大时,我只想让屏幕太大而无法从边缘掉下来的部分(基本上,不适合屏幕的部分只会不可见)。关于如何做到这一点的任何想法?

4

1 回答 1

1

设置ImageView.ScaleTypeMATRIX,然后提供适当的矩阵来进行缩放。

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);

高温高压

于 2012-06-20T21:15:09.970 回答