The matrix manipulation, something that is used prominently in bitmap blitting, is a bit difficult for me to grasp correctly. Especially at the point where the Matrix involves pre- or post- when doing calculations (preScale(), preSkew(), preTranslate(), etc., and postScale(), postSkew(), etc.)
I'm using the class "android.graphics.Matrix", and not the "android.opengl.Matrix", just to clarify.
[source lang="java"] Matrix matrix = new Matrix(); matrix.reset();[/source]
I think this initializes the matrix variable.
[source lang="java"]Canvas c = holder.lockCanvas(); c.drawRGB(128, 128, 120); matrix.postScale(-1, 1); c.drawBitmap(bitmap, matrix, null); holder.unlockCanvasAndPost©;[/source]
After that, the bitmap itself does nothing. What am I doing wrong? Isn't it?:
[source lang="java"] 1 0 * [-1] = -1 0 0 1 [ 1] 0 1[/source]
Edited by tom_mai78101, 24 September 2012 - 06:13 AM.






