How to draw an UIImageView in -drawRect:?
<p>I'm trying since 5 hours now:</p>

<pre><code>- (void)drawRect:(CGRect)rect {
    // flip the wrong coordinate system
    CGContextTranslateCTM(context, 0.0f, rect.size.height); //shift the origin up
    CGContextScaleCTM(context, 1.0f, -1.0f); //flip the y-axis

    CGContextDrawImage(context, myImgView.frame, myImageView.image.CGImage);
}
</code></pre>

<p>The problem: While the image draws correctly, the coordinates specified by the UIImageView frame are completely useless. The image appears placed completely wrong on screen.</p>

<p>I guess I must also flip the CGRect of the UIImageView? But how?</p>
