tags:

views:

31

answers:

1

Hi

As the title says I wonder how I can make my images to perspective view. Here's an image showing how they manage to do this in photoshop:

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

Is it possible to do something like this in android?

A: 

Yes.

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

Edit: see http://www.jhlabs.com/ip/filters/index.html for an implementation of a PerspectiveFilter.

Note that you could probably also use openGL to achieve a similar effect. See http://developer.android.com/reference/android/opengl/GLU.html and http://developer.android.com/reference/android/opengl/GLSurfaceView.html

Tedil
It seems like matrix is the way to go, but I can't figure out how I should use it. I tried the following:Matrix srcmatrix = new Matrix();srcmatrix = mImageView.getImageMatrix();srcmatrix.setSkew(4, 4);mImageView.setImageMatrix(srcmatrix);mImageView is the View Which contains my bitmap image.
Henrik