我创建了一个图像库,一切正常.要放大并移动图像是必需的
ImgView.setScaleType (ImageView.ScaleType.MATRIX)
Run Code Online (Sandbox Code Playgroud)
当我这样做时,我得到的图像很小,所以我称之为方法
scaleFactor = view.getWidth()/(float)view.getDrawable().getIntrinsicWidth();
matrix.setScale(scaleFactor, scaleFactor);
Run Code Online (Sandbox Code Playgroud)
所以不要错过图像大小,但正如您所看到的,图像高于一切,需要保持在屏幕的中心.
我试过这个
matrix.postTranslate((screen_width-image_width)/2, (screen_height-image_height)/2);
Run Code Online (Sandbox Code Playgroud)
但是不行.
任何的想法?很抱歉没有插入图片,但我不能因为我的声誉.非常感谢你提前