问题描述
我想旋转(-45 到 45 度,如倾斜特征)并根据度数缩放图像。
我尝试通过使用此计算(角度 * Math.PI)/ 180.0 来设置比例值。但它不是根据图像大小缩放图像。如果我设置水平图像意味着图像的左侧和右侧有一个空格。
您能就此提出任何建议吗?
解决方法
我能够使用以下代码旋转图像。 compasImageView 是我旋转 360 度的图像
private void Rotateimage(double angle)
{
ObjectAnimator objectAnimator = ObjectAnimator.OfFloat(compasImageView,"rotation",130,0f);
objectAnimator.SetDuration(500);
objectAnimator.Start();
compasImageView.Animate().RotationBy((float)angle).SetDuration(1500).SetInterpolator(new LinearInterpolator()).Start();
}
能否请您分享您的代码。如果建议的代码没有帮助。