CALayer colorWithPatternImage UIImageOrientation

时间:2012-11-10 18:31:39

标签: iphone ios calayer uiimageorientation

我已成功使用colorWithPatternImage在我用作演示文稿背景的CALayer中创建背景颜色。但是,图像以颠倒的颜色显示。我从阅读帖子和文档的数小时了解到这是因为反向屏幕坐标。

所以,我尝试了这段代码,这是我在阅读过几个小时后发现的,但它不起作用。

下面使用的pImage先前是从NSURLConnection加载的。

flippedImage = [UIImage imageWithCGImage:pImage.CGImage scale: 1.0f orientation: UIImageOrientationDownMirrored];

self.backgroundColor = [UIColor colorWithPatternImage:flippedImage].CGColor;

self.anchorPoint = CGPointMake(0.0,0.0);

我应该说我在后台线程中这样做。我还尝试了文档中的其他方向,但没有一个方向适用于我的代码。

谢谢

1 个答案:

答案 0 :(得分:0)

翻转图层!?将geometryFlipped设置为YES

相关问题