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
Post a Comment