rotate an image aroound a point
<p>I have an image which is of rectangular dimension, eg 30 x 60 pixels
 I want to rotate this image around the bottom center of the image, i.e 
 i want to set the pivot in the above example as (15, 60 )pixel.</p>

<p>I am using a drawble and matrix to get this done, 
 whatever i try i always end up rotating around center of the image.</p>

<p>Code is :</p>

<pre><code>Bitmap bitmapOrg = BitmapFactory.decodeFile("/sdcard/DCIM/2010-06-01_15-32-42_821.jpg");
</code></pre>

<p>//            float angle =  (angle + 10.0f)%360.0f; 
            if(null !=bitmapOrg)
            {</p>

<pre><code>             int width = bitmapOrg.getWidth();
             int height = bitmapOrg.getHeight();
             int newWidth = 15;
             int newHeight = 15;

             // calculate the scale - in this case = 0.4f
             float scaleWidth = ((float) newWidth) / width;
             float scaleHeight = ((float) newHeight) / height;
</code></pre>

<p>/*                 Canvas c = new Canvas(bitmapOrg);
                 float px = ;
                float py;
                c.rotate(angle, px, py)*/</p>

<pre><code>             // createa matrix for the manipulation
             Matrix matrix = new Matrix();
             // resize the bit map
             matrix.postScale(scaleWidth, scaleHeight);
             // rotate the Bitmap
</code></pre>

<p>//                 matrix.postRotate(45);</p>

<pre><code>             // recreate the new Bitmap
             Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0, 
                               width, height, matrix, true); 

             // make a Drawable from Bitmap to allow to set the BitMap 
             // to the ImageView, ImageButton or what ever
             BitmapDrawable bmd = new BitmapDrawable(resizedBitmap);

             ImageView imageView = new ImageView(this);

             // set the Drawable on the ImageView
             imageView.setImageDrawable(bmd);

             // center the Image
             imageView.setScaleType(ScaleType.CENTER);
</code></pre>

<p>//                 imageView.layout(100, 300, 0, 0);
//                 linLayout.addView(imageView);</p>

<pre><code>             // add ImageView to the Layout
             linLayout.addView(imageView, 
                new AbsoluteLayout.LayoutParams(
                           LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 10, 30
                     )
             );
</code></pre>

<p>can anyone let me know how to get this rectified?</p>
