Rotate the Portion Made By User and Not the Entire Canvas in Android
<p>I am trying to create an application. In which whatever user creates (doodle) on the screen . I would like to rotate that portion only what the user created. I donot want the entire Canvas to rotate because there are other things on the canvas. 
Example: Suppose On Canvas I have two images and the User Create a line . I want only the line to rotate, scale etc and not the two images. </p>

<p>My Code </p>

<pre><code>public class DoodleEngine extends View {
private Paint paint = new Paint();
private Path path = new Path();
Bitmap bitmap ;
Canvas bitmapCanvas; 

public DoodleEngine(Context context, AttributeSet attrs) {
super(context, attrs);

paint.setAntiAlias(true);
paint.setStrokeWidth(6f);
paint.setColor(Color.GREEN);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeJoin(Paint.Join.ROUND);

/*
bitmap = Bitmap.createBitmap(getWidth(), getHeight(), 
        Bitmap.Config.ARGB_8888);
bitmapCanvas = new Canvas(bitmap);
*/

}

@Override
protected void onDraw(Canvas canvas) {

  canvas.drawPath(path, paint);



}

@Override
public boolean onTouchEvent(MotionEvent event) {
float eventX = event.getX();
float eventY = event.getY();

switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:

  path.reset();
  invalidate();
  path.moveTo(eventX, eventY);
  return true;
case MotionEvent.ACTION_MOVE:
  path.lineTo(eventX, eventY);


  break;
case MotionEvent.ACTION_UP:

  break;
default:
  return false;
}


invalidate();
return true;
}
} 
</code></pre>
