2012-06-20 59 views
0

首先,我不想放大圖像的特定區域。我想要的形象只會越來越強烈,當它變得太大的屏幕,我只想過大的屏幕,只是脫落邊緣(本質上是不適合在屏幕上的部分將只是部分不可見)。任何想法如何做到這一點?安卓:放大影像屏幕過去

回答

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

HTH