I need to draw a series of PNGs into a CGContext
so I can blend them together:
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetBlendMode(context, kCGBlendModeOverlay);
Currently I have my app working based on just drawing each image as a UIImageView and adding them as a subview to the view file via: [self addSubview:someImageView]
...but this doesn't allow for blending mode manipulation, right?
Currently the UIImageView vars are being assigned via:
someImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image-name.png"]];
So I've tried replacing those with either of these with no luck:
[[UIImage imageNamed:@"image-name.png"] drawInRect:rect blendMode:kCGBlendModeOverlay alpha:1.0];
and this one needs a CGImage
which I'm not sure how to make with the PNGs:
CGContextDrawImage(context, rect, someCGImage);
So what am I missing? These aren't being triggered by any interaction, they just need to load/draw when the app loads.
Thanks for any leads. :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…