I'm trying to rotate the canvas around the center of the screen, to get the (0,0) coordinates at the bottom right.

This is how I do it:

Display display = getWindowManager().getDefaultDisplay(); 
int width = display.getWidth();
int height = display.getHeight();
canvas.rotate(180, width/2, height/2);

It does rotate correctly, and everything is perfect at the AVD with API level 17. But on the AVD with API level 8 the (0,0) coordinate appears at the wrong place. Before rotation the picture was fitting the whole screen at this device too, but now it looks like this:

enter image description here

what is causing the problem?

*EDIT!

The problem is resolved by rotating the canvas around its own middle point:

canvas.rotate(180,canvas.getWidth()/2,canvas.getHeight()/2);

But still, why doesn't the previous version work with older APIs?

Edit
Report