android 应该是什么 pivot 用于在其中心基座周围的图像旋转
在进行复制或关闭之前,请仔细阅读整个问题。
我想旋转图像 /特别是,
箭头的图像
/ 围绕其基地的中心点。
例如,在我的图像的开头,在几小时内将看起来像第二个箭头 9.
并假设如果我打开此图像 30 度,然后它看起来像一个第二个时钟箭头 10, 如果是 120 度,然后是第二个时钟箭头 1.
所以我想把这个图像翻转到他的中心 /沿着轴 x/ 基础。
那么我应该怎么去 pivot /X & Y/, 如果我先澄清
或第二码
或第三码
或第四码
添加了一个更好的理解,以便更好地了解 90 顺时针方向。
我希望将来希望 google 添加更多和清晰的文档 pivot 要点。
先感谢您。
我想旋转图像 /特别是,
箭头的图像
/ 围绕其基地的中心点。
例如,在我的图像的开头,在几小时内将看起来像第二个箭头 9.
并假设如果我打开此图像 30 度,然后它看起来像一个第二个时钟箭头 10, 如果是 120 度,然后是第二个时钟箭头 1.
所以我想把这个图像翻转到他的中心 /沿着轴 x/ 基础。
那么我应该怎么去 pivot /X & Y/, 如果我先澄清
imageView.setPivotX/1f/;
imageView.setPivotY/1f/;
imageView.setRotation/-30/;
或第二码
Matrix matrix = new Matrix//;
imageView.setScaleType/ScaleType.MATRIX/;
matrix.postRotate//float/ 20, 0f, 0f/;
imageView.setImageMatrix/matrix/;
或第三码
Bitmap myImg = BitmapFactory.decodeResource/getResources//, R.drawable.arrow_0_degree/;
Matrix matrix = new Matrix//;
matrix.postRotate/30/;
Bitmap rotated = Bitmap.createBitmap/myImg, 0, 1, myImg.getWidth//, myImg.getHeight//, matrix, true/;
imageView.setImageBitmap/rotated/;
或第四码
final RotateAnimation rotateAnim = new RotateAnimation/0.0f, degree,
RotateAnimation.RELATIVE_TO_SELF, 0.5f,
RotateAnimation.RELATIVE_TO_SELF, 0.5f/;
rotateAnim.setDuration/0/;
rotateAnim.setFillAfter/true/;
imgview.startAnimation/rotateAnim/;
添加了一个更好的理解,以便更好地了解 90 顺时针方向。
我希望将来希望 google 添加更多和清晰的文档 pivot 要点。
先感谢您。
没有找到相关结果
已邀请:
1 个回复
快网
赞同来自:
你可以实现这一点 :