rotation - Rotating a bitmap on an axis in Android -


i have bitmap flush bottom of screen. when user clicks button want rotate right 1 degree. able accomplish problem bottom of item no longer flush screen. need appear rotate on bottom axis. use hack increment x , y when rotated (using trial , error suppose) there formula or more elegant can use?

public void rotate(int degrees)     {         matrix mat = new matrix();         mat.postrotate(degrees);         bitmap = bitmap.createbitmap(bitmap, 0, 0, bitmap.getwidth(), bitmap.getheight(), mat, true);            } 

could not instead use following method matrix has:

postrotate (float degrees, float px, float py) 

it enables rotation on specified point.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -