To do this, we translate by an additional amount -- half the image width and half the image height.
But that would just draw the image with it's top left corner at the new zero point, so instead we draw the image back (negative) by half its width and half its height.
Click next to see this in action.
|