0

I have a rectangular image which gets transformed applying image.setLayoutMatrix3D(matrix3D). I need to calculate the actual dimensions and position (in pixels) of the image after the transformation.

In this scenario there are no rotations to the image applied. The matrix3D has the following structure:

1       0       0       0
0       1       0       0
0       0       1       0
value1  value2  value3  1

Provided that the original position and size of image are originalWidth, originalHeight, originalX and originalY how can I calculate the new dimension and position?

Thanks!

4

1 回答 1

0

Admittedly, I've never done this with a matrix applied, but, I believe you can use: image.getLayoutBoundsWidth(), image.getLayoutBoundsHeight(), image.getLayoutBoundsX(), and image.getLayoutBoundsY() to get these values.

These methods from the ILayoutElement interface have a default boolean argument, postLayoutTransform (defaults to to true). When postLayoutTransform is true, the functions return values with the transformation applied.

于 2013-07-29T06:27:04.307 回答