问题
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.
How do I perform a similar operation on Android? Any pointers will be greatly appreciated. Thanks.
回答1:
You can use the Matrix.mapPoints class for this. For example:
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);
//...
来源:https://stackoverflow.com/questions/9019469/how-to-perform-a-similar-operation-as-affinetransform-transform-on-android