为什么 obj2 不与 obj1 混合但不使用 CGLayer 它工作正常,与 CGContextDrawLayerAtPoint 相同的问题,CGLayer 不支持 CGContextSetBlendMode 吗?
//Layer
CGContextRef context = UIGraphicsGetCurrentContext();
CGLayerRef objectLayer = CGLayerCreateWithContext (context, rect.size, NULL);
CGContextRef objectContext = CGLayerGetContext (objectLayer);
//obj1
CGContextDrawImage(objectContext, CGRectMake(0, 0, rect.size.width, rect.size.height), [[UIImage imageNamed:@"background.png"] CGImage]);
//obj2
CGContextSetBlendMode(objectContext, kCGBlendModeSoftLight);
CGContextSetAlpha(objectContext, 0.5f);
CGContextDrawImage(objectContext, CGRectMake(0, 0, rect.size.width, rect.size.height), [[UIImage imageNamed:@"overlay1.png"] CGImage]);
CGContextDrawLayerInRect(context, rect, objectLayer);