【发布时间】:2010-04-23 08:50:13
【问题描述】:
我从现在开始尝试 5 个小时:
- (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);
}
问题:虽然图像绘制正确,但 UIImageView 框架指定的坐标完全没用。图像在屏幕上的位置完全错误。
我想我还必须翻转 UIImageView 的 CGRect 吗?但是怎么做呢?
【问题讨论】:
标签: iphone