1

我想为图像添加透明覆盖我正在使用它的代码:

 - (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;
        }

问题是我得到的最终图像不清晰并且失真。

请帮忙

4

0 回答 0