我想为图片添加透明叠加层 我正在使用它的代码:
- (UIImage *) overlayImage
{
VampirizerAppDelegate* app = (VampirizerAppDelegate *)[UIApplication sharedApplication].delegate;
UIImage* pSourceImage;
pSourceImage = pTempResult;
UIImage *topOverlayImg = [UIImage imageNamed:@"overlay-disco-lights-top.png"];
// size is taken from the background image
UIGraphicsBeginImageContext(pSourceImage.size);
[pSourceImage drawAtPoint:CGPointZero];
CGRect topImageRect = CGRectMake(0, 0, pSourceImage.size.width, pSourceImage.size.height);
[pSourceImage drawInRect:topImageRect blendMode:kCGBlendModeOverlay alpha:0.99];
NSLog(@"topImageRect : %@", NSStringFromCGRect(topImageRect));
UIImage *combinedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return combinedImage;
}
问题是我得到的最终图像不清晰且失真。
请帮忙