Make an image in perspective

As the title says, I wonder how I can make my images look promising. Here's an image showing how they do it in Photoshop:

http://netlumination.com/blog/creating-perspective-and-a-mirror-image-in-photoshop

Is it possible to do something like this in android?

+3
source share
2 answers

Yes.

Have a look at this page http://www.inter-fuser.com/2009/12/android-reflections-with-bitmaps.html . Then you can apply AffineTransform (at least in AWT, but Android should have something similar too) using matrix to distort / skew the image.

: . http://www.jhlabs.com/ip/filters/index.html PerspectiveFilter.

, , , openGL . . http://developer.android.com/reference/android/opengl/GLU.html http://developer.android.com/reference/android/opengl/GLSurfaceView.html p >

+1

, 0 60:

    Matrix imageMatrix = new Matrix();
    float[] srcPoints = {
        0, 0,
        0, 200,
        200, 200,
        200, 0};

    float[] destPoints = {
        rotation, rotation/2f,
        rotation, 200 - rotation/2f,
        200 - rotation, 200,
        200 - rotation, 0};
    imageMatrix.setPolyToPoly(srcPoints, 0, destPoints, 0, 4);
0

Source: https://habr.com/ru/post/1758520/


All Articles