Could someone help me to transform this sub to B4A.
Thanks in advance.
Thanks in advance.
B4X:
Public static Bitmap perspectiveTransformation(Bitmap bitmap,BoundingQuad boundingQuad)
{
matrix matrix = new matrix();
float[] dst = new float[] {
0,
0,
bitmap.getWidth(),
0,
bitmap.getWidth(),
bitmap.getHeight(),
0,
bitmap.getHeight()
};
float[] src = new float[] {
boundingQuad.topLeft.x,
boundingQuad.topLeft.y,
boundingQuad.topRight.x,
boundingQuad.topRight.y,
boundingQuad.bottomRight.x,
boundingQuad.bottomRight.y,
boundingQuad.bottomLeft.x,
boundingQuad.bottomLeft.y
};
matrix.setPolyToPoly(src, 0, dst, 0, src.length >> 1);
Return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, True);
}