Android Drawing text on canvas
<p>I am drawing a speedometer on a ImageView that contains the bg. I use this code for the ticks and the values</p>

<pre><code>    for (int i = 0; i &lt; 270; i += 5) {
        if (i % 30 == 0) {
            scalePaint.setStrokeWidth(2f);
            canvas.drawLine(3.55f * wQuarter, 2 * hQuarter,
                    3.78f * wQuarter, 2 * hQuarter, scalePaint);
            canvas.drawText(String.valueOf(i), 3.5f * wQuarter,
                    2f * hQuarter, scalePaint);


        } else {
            scalePaint.setStrokeWidth(1.5f);
            canvas.drawLine(3.65f * wQuarter, 2 * hQuarter,
                    3.78f * wQuarter, 2 * hQuarter, scalePaint);

        }
        canvas.rotate(5f, 2 * wQuarter, 2 * hQuarter);
    }
</code></pre>

<p>the ticks are drawn as they should, but the problem is the text is also rotated with the canvas. How can I keep the text position while resetting its rotation? most of it is upside down or at +90 -90</p>

<p>here it is<img src="http://i.stack.imgur.com/BW90x.png" alt="enter image description here"></p>
