Translate Canvas and get the new X Y coord

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Translate Canvas and get the new X Y coord

Postby jmachete » Wed Feb 09, 2011 12:14 pm

Hi Guys,

Im applying some transformation to my canvas, but now I need to get the new position on screen of that canvas.

Code: Select all
final Matrix matrixFinal;

canvas.save(Canvas.MATRIX_SAVE_FLAG);
matrixFinal = canvas.getMatrix();
matrixFinal.setTranslate(-4.0f, 2.0f);
canvas.concat(matrixFinal);


After this operation how I can get the exact X Y screen coord of this canvas?


Cheers
Joao
jmachete
Freshman
Freshman
 
Posts: 3
Joined: Mon Jan 10, 2011 6:40 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: Google [Bot] and 6 guests