android.graphics.Matrix.setTranslate(x, y);
画像の左上を x, y に移動
android.graphics.Matrix.postScale(scalex, scaley, x, y);
画面の x, y を中心(固定点)に今のサイズに横幅 scalex, 縦幅 scaley をかける
android.graphics.Matrix.setScale(scalex, scaley);
初期画像の scalex, scaley 倍にする。
なぜか setScale のあとに setTranslate を呼ぶと倍率が元画像の1倍にもどるので注意。
ImageViewで上下にスペースができる初期状態に戻したいときは
matrix.setTranslate(0, initY);
float init = (今の倍率から初期倍率に戻すための倍率);
matrix.postScale(init, init, 0, initY);
とやってごまかさないと上手くいかなかった。。。
画像の左上を x, y に移動
android.graphics.Matrix.postScale(scalex, scaley, x, y);
画面の x, y を中心(固定点)に今のサイズに横幅 scalex, 縦幅 scaley をかける
android.graphics.Matrix.setScale(scalex, scaley);
初期画像の scalex, scaley 倍にする。
なぜか setScale のあとに setTranslate を呼ぶと倍率が元画像の1倍にもどるので注意。
ImageViewで上下にスペースができる初期状態に戻したいときは
matrix.setTranslate(0, initY);
float init = (今の倍率から初期倍率に戻すための倍率);
matrix.postScale(init, init, 0, initY);
とやってごまかさないと上手くいかなかった。。。








