rotate image around a center of another image

后端 未结 1 1087
猫巷女王i
猫巷女王i 2021-01-20 12:40

I have rotated a dial around its center with the helop from the link below:

http://mobile.tutsplus.com/tutorials/android/android-sdk-creating-a-rotating-dialer/

<
相关标签:
1条回答
  • 2021-01-20 13:38

    Try only rotate with peopleOrg width and height.

    nMatrix.postRotate(degrees, peopleOrg.getWidth()/2, peopleOrg.getHeight()/2);
    

    Update :

    Now that you let me know that your logo should be a clickable view, merging the logo image with your dialer is not applicable. To rotate the logo view around the center of dialer you should be actually calculating the (top,left) point for your logo view and moving it around, than just rotating it.

    Use sine and cosine functions to get the point on the circumference of an imaginary circle for drawing your logo view.

    This post will help you with calculations : How do I calculate a point on a circle’s circumference?

    0 讨论(0)
提交回复
热议问题