0
我在屏幕上旋轉圖像時總是出現問題,我總是在相同的軸心點上旋轉,我知道這是(0,0),這就是我想要的實現它:ImageView.setPivot屬性不響應數據
private Evidence setVehiclePosition (String sCombination, PointF startPoint,
PointF endPoint, int position, final Evidence myEvidence) {
myEvidence.geteImage().setOnTouchListener(this);
imgViewSelected.setPivotX(imgViewSelected.getWidth());
imgViewSelected.setPivotY(imgViewSelected.getHeight());
double angle = MyTrigonometry.angleTwoVectors(startPoint, endPoint);
PointF imageLocation = null;
switch (sCombination){
case "C1":
//angle += 180;
break;
case "C2":
angle += 90;
break;
case "C3":
break;
case "C4":
//angle += 270;
break;
}
imgViewSelected.setRotation((int) angle);
imageLocation =
MyConvert.MtsToPixs(MyTrigonometry.getCornerrPoint(startPoint, endPoint,
MyConvert.PixsToMts(myEvidence.geteImage().getHeight())));
imgViewSelected.setTranslationX((imageLocation.x +
MyConvert.getOffset().x));
imgViewSelected.setTranslationY(MyConvert.getScreenResolution().y - ((imageLocation.y) + MyConvert.getOffset().y));
}
不管什麼我把setPivot(東西),它只是保持在這個問題上旋轉過同樣的觀點,任何提示裏面?
期望的結果: