In the onDraw() method, why does the supplied Canvas already have scale?
<p>In a current test project I have a custom View, that I have named SVGView, that simply paints some vector graphics (Paths, etc.) to the Canvas. </p>

<p>The XML layout file consists of nothing more than a FrameLayout, which contains a single child SVGView. The <code>android:layout_width</code> and <code>android:layout_height</code> attributes for the SVGView in the current example are both set to <code>300px</code> (which the containing FrameLayout has more than enough room to accommodate). In the SVGView's <code>onMeasure()</code>, the call to <code>setMeasuredDimension()</code> is given the arguments 300, 300. </p>

<p>When the <code>onDraw()</code> method is called to draw the graphics to the Canvas object, I find that the Canvas doesn't have an identity matrix; rather, the Canvas has some amount of scale transformation already applied. What's the reason for this? I (wrongly) assumed that the Canvas would have a scaling of 1, because the actual dimensions of the View, its Canvas, and its representation on the screen all match. </p>

<p>I'm asking this in relation to the problem I have described in detail in my earlier question here: <a href="http://stackoverflow.com/questions/6278509/canvas-drawing-cache-bitmap-is-slightly-blurred-or-has-anti-alias">Canvas drawing cache bitmap is slightly blurred or has anti-alias</a>. I'm finding that when I draw the cache bitmap back to the Canvas, it's slightly blurred compared to the original vector graphics, despite the fact that I'm drawing the bitmap back using no rescaling and using a Paint with anti-alias turned off. I'm now just absolutely convinced there there has to be <em>some</em> scaling process that I'm unaware of causing this to happen to the bitmap. To discover that the Canvas argument to onDraw() has some scaling transformation already applied is possibly a big clue to solving this problem -- but I can't understand why it has such scaling, when surely the Canvas' dimensions perfectly match the area of the screen it's ultimately painting to.</p>

<p>Thanks,</p>

<p>Trev</p>
