是否可以在特定角落拉伸(stretch)位图?下图展示了我的 Intent :
我用相机拍摄一张照片,检测图像中的角并想要转换内容。据我所知,Matrix 无法实现这一点。单独上课。 Camera类应该有帮助,但我需要计算相机的位置。是否有用于此目的的算法?你会怎么做?
最佳答案
你让我研究了这个非常有趣的问题,在 Android 中似乎很容易做到。 Mesh的四个点使用绝对坐标:
float[] mVerts = {
topLeftX, topLeftY,
topRightX, topRightY,
bottomLeftX, bottomLeftY,
bottomRightX, bottomRightY
};
canvas.drawBitmapMesh(myImage, 1, 1, mVerts, 0, null, 0, null);
您必须弄清楚如何获得这些点,但 drawBitmapMesh 会为您拉伸(stretch)它。
关于android - 在特定角落拉伸(stretch)位图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15387946/