How to rotate image with fix point along with touch in android
<p>I've been looking for over a day for a solution to this problem but nothing helps, even the answers here dont help me....
ma problem is ma image is rotating but not bitmap size is varing while rotating .....</p>

<p>here is ma code </p>

<pre><code>package dharam.rotate;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.os.Bundle;
import android.provider.ContactsContract.CommonDataKinds.Event;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

public class Rotate extends Activity {
    View baseView ;
    ImageView turntable;
    TextView bottomText;
    GestureDetector   gestureDetector;
    private float x , y;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.main);

    baseView = (View) findViewById(R.id.baseView);
    turntable = (ImageView) findViewById(R.id.turntable);

    turntable.setOnTouchListener(onTableTouched);
    baseView.setOnTouchListener(onTableTouched);
}

public android.view.View.OnTouchListener onTableTouched = new android.view.View.OnTouchListener() {
    public boolean onTouch(View v, MotionEvent evt) {
        double r = Math.atan2(evt.getX() - turntable.getWidth() / 2,
                (turntable.getHeight() / 2) - evt.getY());
        int rotation = (int) Math.toDegrees(r);
        Log.i("R is ", ""+r);
        if (evt.getAction() == MotionEvent.ACTION_DOWN) {
        }

        if (evt.getAction() == MotionEvent.ACTION_MOVE) {
            x= evt.getX();
            y= evt.getY();
            updateRotation(rotation);
        }

        if (evt.getAction() == MotionEvent.ACTION_UP) {
                //
        }
        return true;
    }
};
private void updateRotation(double rot) {
    float newRot = new Float(rot);
    Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
    R.drawable.orsl_circle_transparent);
    Matrix matrix = new Matrix();
//        matrix.setTranslate(getWindowManager().getDefaultDisplay().getWidth()/2, getWindowManager().getDefaultDisplay().getHeight());
        matrix.postRotate(newRot,bitmap.getWidth()/2,bitmap.getHeight()/2);
//      matrix.setSinCos(newRot, newRot/2, 100, 100);
//      matrix.postRotate(newRot);
        Log.i("THE ROATTION ", "  "+    newRot);

    if(y&gt;250)
    {
        Bitmap redrawnBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap
                .getWidth(), bitmap.getHeight(), matrix, true);
        turntable.setImageBitmap(redrawnBitmap);
    }else
    {
        Bitmap  redrawnBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap
                .getWidth(), bitmap.getHeight(), matrix, true);
         turntable.setImageBitmap(redrawnBitmap);
         Log.i("GUITAR _IMAGE", "");
    }

}
</code></pre>

<p>}</p>
