animation - How to rotate particular image among multiple images drawn to canvas in android? -


I need to rotate an image around the center of an axis between several images that rotate an image, Are ready for canvas.

I am loading images in the canvas below.

  canvas.drawBitmap (mMachineBackground, 0, 0, null); Canvas davarabitmap (mmchinator, 0, 0, empty);  

Instead of rotating the entire canvas, instead I want to rotate the other bitmap around the center of my axis (which includes the first bitmap).

Thanks in advance. /p>

You can move around the center axis:

  Matrix metrics = New matrix (); // step image matrix .Settranslate (getXPos () - (imageWidth / 2), getYPos () - (imageHyight / 2)); // To rotate the image, getXPos, getYPos X & amp; Image matrix. PostRotate (angleInDegrees, getXPos () - imageWidth / 2, getYPos () - imageHyight / 2 y core;); // rotatedBMP is the image you are drawing, canvas.drawBitmap (rotatedBMP, matrix, paint);  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -