gpt4 book ai didi

android - 如何在 Android 上执行类似 AffineTransform.transform 的操作?

转载 作者:行者123 更新时间:2023-11-29 15:28:51 25 4
gpt4 key购买 nike

public Point2D transform(Point2D ptSrc, Point2D ptDst)

Transforms the specified ptSrc and stores the result in ptDst. If ptDst is null, a new Point2D object is allocated and then the result of the transformation is stored in this object. In either case, ptDst, which contains the transformed point, is returned for convenience. If ptSrc and ptDst are the same object, the input point is correctly overwritten with the transformed point.

如何在 Android 上执行类似的操作?任何指针将不胜感激。谢谢。

最佳答案

您可以使用 Matrix.mapPoints为此上课。例如:

Matrix m = new Matrix(orig);
m.preScale(scale, scale);
m.postTranslate(x, y);

float[] src = { 0.5, 0.3 };
float[] dst = new float[2];
m.mapPoints(dst, src);
//...

关于android - 如何在 Android 上执行类似 AffineTransform.transform 的操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9019469/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com